Skip to content

Commit 48dd2fd

Browse files
committed
Merge: Backport stat fix to stay in sync with 9.7
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1171 JIRA: https://issues.redhat.com/browse/RHEL-102383 ``` commit c2a2ff6 Author: Antoine Tenart <atenart@kernel.org> Date: Tue Jul 1 09:49:34 2025 +0200 net: ipv4: fix stat increase when udp early demux drops the packet udp_v4_early_demux now returns drop reasons as it either returns 0 or ip_mc_validate_source, which returns itself a drop reason. However its use was not converted in ip_rcv_finish_core and the drop reason is ignored, leading to potentially skipping increasing LINUX_MIB_IPRPFILTER if the drop reason is SKB_DROP_REASON_IP_RPFILTER. This is a fix and we're not converting udp_v4_early_demux to explicitly return a drop reason to ease backports; this can be done as a follow-up. Fixes: d46f827 ("net: ip: make ip_mc_validate_source() return drop reason") Cc: Menglong Dong <menglong8.dong@gmail.com> Reported-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: Antoine Tenart <atenart@kernel.org> Reviewed-by: Sabrina Dubroca <sd@queasysnail.net> Link: https://patch.msgid.link/20250701074935.144134-1-atenart@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> ``` Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com> --- <small>Created 2025-07-08 14:27 UTC by backporter - [KWF FAQ](https://red.ht/kernel_workflow_doc) - [Slack #team-kernel-workflow](https://redhat-internal.slack.com/archives/C04LRUPMJQ5) - [Source](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/webhook/utils/backporter.py) - [Documentation](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/docs/README.backporter.md) - [Report an issue](https://issues.redhat.com/secure/CreateIssueDetails!init.jspa?pid=12334433&issuetype=1&priority=4&summary=backporter+webhook+issue&components=kernel-workflow+/+backporter)</small> Approved-by: Jarod Wilson <jarod@redhat.com> Approved-by: Paolo Abeni <pabeni@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Julio Faracco <jfaracco@redhat.com>
2 parents 13e9beb + 14931d7 commit 48dd2fd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

net/ipv4/ip_input.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ static int ip_rcv_finish_core(struct net *net, struct sock *sk,
319319
const struct sk_buff *hint)
320320
{
321321
const struct iphdr *iph = ip_hdr(skb);
322-
int err, drop_reason;
323322
struct rtable *rt;
323+
int drop_reason;
324324

325325
if (ip_can_use_hint(skb, iph, hint)) {
326326
drop_reason = ip_route_use_hint(skb, iph->daddr, iph->saddr,
@@ -345,9 +345,10 @@ static int ip_rcv_finish_core(struct net *net, struct sock *sk,
345345
break;
346346
case IPPROTO_UDP:
347347
if (READ_ONCE(net->ipv4.sysctl_udp_early_demux)) {
348-
err = udp_v4_early_demux(skb);
349-
if (unlikely(err))
348+
drop_reason = udp_v4_early_demux(skb);
349+
if (unlikely(drop_reason))
350350
goto drop_error;
351+
drop_reason = SKB_DROP_REASON_NOT_SPECIFIED;
351352

352353
/* must reload iph, skb->head might have changed */
353354
iph = ip_hdr(skb);

0 commit comments

Comments
 (0)