aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_forward.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-05-12 19:34:30 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-12 19:34:30 -0400
commitdef57687e9579b7a797681990dff763c411f5347 (patch)
tree24e1b96d286eda163cf98cf4d5eb5a1d24b34737 /net/ipv4/ip_forward.c
parentipv4: Simplify iph->daddr overwrite in ip_options_rcv_srr(). (diff)
downloadlinux-dev-def57687e9579b7a797681990dff763c411f5347.tar.xz
linux-dev-def57687e9579b7a797681990dff763c411f5347.zip
ipv4: Elide use of rt->rt_dst in ip_forward()
No matter what kind of header mangling occurs due to IP options processing, rt->rt_dst will always equal iph->daddr in the packet. So we can safely use iph->daddr instead of rt->rt_dst here. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_forward.c')
-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 99461f09320f..fcbc0c8f1261 100644
--- a/net/ipv4/ip_forward.c
+++ b/net/ipv4/ip_forward.c
@@ -84,7 +84,7 @@ int ip_forward(struct sk_buff *skb)
rt = skb_rtable(skb);
- if (opt->is_strictroute && rt->rt_dst != rt->rt_gateway)
+ if (opt->is_strictroute && iph->daddr != rt->rt_gateway)
goto sr_failed;
if (unlikely(skb->len > dst_mtu(&rt->dst) && !skb_is_gso(skb) &&