]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: Don't override return code from ip_route_input_noref()
authorStefano Brivio <sbrivio@redhat.com>
Thu, 31 Aug 2017 16:11:41 +0000 (18:11 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 Sep 2017 17:54:27 +0000 (10:54 -0700)
commit76bb6f41ee687f188fb79b967be657bf3e0bb287
tree8e91ed6bde230252c4225219153af5a1682f8544
parente98231c1bdf3d901549231261c9fceacd1f1e7f4
ipv4: Don't override return code from ip_route_input_noref()

After ip_route_input() calls ip_route_input_noref(), another
check on skb_dst() is done, but if this fails, we shouldn't
override the return code from ip_route_input_noref(), as it
could have been more specific (i.e. -EHOSTUNREACH).

This also saves one call to skb_dst_force_safe() and one to
skb_dst() in case the ip_route_input_noref() check fails.

Reported-by: Sabrina Dubroca <sdubroca@redhat.com>
Fixes: 2dbdcacb4b91 ("ipv4: call dst_hold_safe() properly")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Acked-by: Wei Wang <weiwan@google.com>
Acked-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/route.h