]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
ipv4: fix forwarding for strict source routes
authorJulian Anastasov <ja@ssi.bg>
Mon, 8 Oct 2012 11:41:16 +0000 (11:41 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Oct 2012 21:42:35 +0000 (17:42 -0400)
After the change "Adjust semantics of rt->rt_gateway"
(commit f8126f1d51) rt_gateway can be 0 but ip_forward() compares
it directly with nexthop. What we want here is to check if traffic
is to directly connected nexthop and to fail if using gateway.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_forward.c

index ab09b126423ce3e56fd1fee2f6bda54e4b851022..7f35ac26a71a33d0f5ce1a32c5952814882999d6 100644 (file)
@@ -85,7 +85,7 @@ int ip_forward(struct sk_buff *skb)
 
        rt = skb_rtable(skb);
 
-       if (opt->is_strictroute && opt->nexthop != rt->rt_gateway)
+       if (opt->is_strictroute && rt->rt_gateway)
                goto sr_failed;
 
        if (unlikely(skb->len > dst_mtu(&rt->dst) && !skb_is_gso(skb) &&