diff options
author | Julian Anastasov <ja@ssi.bg> | 2012-10-08 11:41:16 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-28 10:56:17 -0700 |
commit | 77470c37d5aa126548d5901a1e459ebabdac6308 (patch) | |
tree | feae9935a881bd56376c9bc0e7dc82b6a0575dfd | |
parent | da7819a17b178d73b207439dc3ca537b0d72b984 (diff) | |
download | linux-stable-77470c37d5aa126548d5901a1e459ebabdac6308.tar.gz linux-stable-77470c37d5aa126548d5901a1e459ebabdac6308.tar.bz2 linux-stable-77470c37d5aa126548d5901a1e459ebabdac6308.zip |
ipv4: fix forwarding for strict source routes
[ Upstream commit e0adef0f7456d5d3a3bfe8ea61c7dddf146b40e1 ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | net/ipv4/ip_forward.c | 2 |
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) 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) && |