aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorJulian Anastasov <ja@ssi.bg>2012-10-08 07:41:16 -0400
committerDavid S. Miller <davem@davemloft.net>2012-10-08 17:42:35 -0400
commite0adef0f7456d5d3a3bfe8ea61c7dddf146b40e1 (patch)
treeb8b38b6fac97938a9d1a470969e422de49ddb382 /net/ipv4
parente81da0e113a1b7fc7449ae6213f65f89ccac6d06 (diff)
ipv4: fix forwarding for strict source routes
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>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/ip_forward.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c
index ab09b126423c..7f35ac26a71a 100644
--- a/net/ipv4/ip_forward.c
+++ b/net/ipv4/ip_forward.c
@@ -85,7 +85,7 @@ int ip_forward(struct sk_buff *skb)
85 85
86 rt = skb_rtable(skb); 86 rt = skb_rtable(skb);
87 87
88 if (opt->is_strictroute && opt->nexthop != rt->rt_gateway) 88 if (opt->is_strictroute && rt->rt_gateway)
89 goto sr_failed; 89 goto sr_failed;
90 90
91 if (unlikely(skb->len > dst_mtu(&rt->dst) && !skb_is_gso(skb) && 91 if (unlikely(skb->len > dst_mtu(&rt->dst) && !skb_is_gso(skb) &&