Skip to content

Commit 8c7a6ef

Browse files
atenartkuba-moo
authored andcommitted
ipv4: route: fix drop reason being overridden in ip_route_input_slow
When jumping to 'martian_destination' a drop reason is always set but that label falls-through the 'e_nobufs' one, overriding the value. The behavior was introduced by the mentioned commit. The logic went from, goto martian_destination; ... martian_destination: ... e_inval: err = -EINVAL; goto out; e_nobufs: err = -ENOBUFS; goto out; to, reason = ...; goto martian_destination; ... martian_destination: ... e_nobufs: reason = SKB_DROP_REASON_NOMEM; goto out; A 'goto out' is clearly missing now after 'martian_destination' to avoid overriding the drop reason. Fixes: 5b92112 ("net: ip: make ip_route_input_slow() return drop reasons") Reported-by: Sabrina Dubroca <[email protected]> Cc: Menglong Dong <[email protected]> Signed-off-by: Antoine Tenart <[email protected]> Reviewed-by: Sabrina Dubroca <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 03d120f commit 8c7a6ef

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/ipv4/route.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2445,6 +2445,7 @@ ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
24452445
net_warn_ratelimited("martian destination %pI4 from %pI4, dev %s\n",
24462446
&daddr, &saddr, dev->name);
24472447
#endif
2448+
goto out;
24482449

24492450
e_nobufs:
24502451
reason = SKB_DROP_REASON_NOMEM;

0 commit comments

Comments
 (0)