Skip to content

Commit

Permalink
ipv4: fix forwarding for strict source routes
Browse files Browse the repository at this point in the history
After the change "Adjust semantics of rt->rt_gateway"
(commit f8126f1) 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>
  • Loading branch information
Julian Anastasov authored and David S. Miller committed Oct 8, 2012
1 parent e81da0e commit e0adef0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/ip_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down

0 comments on commit e0adef0

Please sign in to comment.