diff options
author | David S. Miller <davem@davemloft.net> | 2011-05-13 17:15:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-13 17:15:50 -0400 |
commit | 0374d9ceb02eb12fcd65be9dd5df9c911ef93424 (patch) | |
tree | 3731be10072252825feea225a082b2ee4029c293 /net/ipv4 | |
parent | 48e20467227fe540e6bbf3d98df98c2c0fca10f3 (diff) |
ipv4: Kill spurious write to iph->daddr in ip_forward_options().
This code block executes when opt->srr_is_hit is set. It will be
set only by ip_options_rcv_srr().
ip_options_rcv_srr() walks until it hits a matching nexthop in the SRR
option addresses, and when it matches one 1) looks up the route for
that nexthop and 2) on route lookup success it writes that nexthop
value into iph->daddr.
ip_forward_options() runs later, and again walks the SRR option
addresses looking for the option matching the destination of the route
stored in skb_rtable(). This route will be the same exact one looked
up for the nexthop by ip_options_rcv_srr().
Therefore "rt->rt_dst == iph->daddr" must be true.
All it really needs to do is record the route's source address in the
matching SRR option adddress. It need not write iph->daddr again,
since that has already been done by ip_options_rcv_srr() as detailed
above.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ip_options.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index c5c26192b057..c6474cd1cbfa 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c | |||
@@ -573,7 +573,6 @@ void ip_forward_options(struct sk_buff *skb) | |||
573 | if (srrptr + 3 <= srrspace) { | 573 | if (srrptr + 3 <= srrspace) { |
574 | opt->is_changed = 1; | 574 | opt->is_changed = 1; |
575 | ip_rt_get_source(&optptr[srrptr-1], rt); | 575 | ip_rt_get_source(&optptr[srrptr-1], rt); |
576 | ip_hdr(skb)->daddr = rt->rt_dst; | ||
577 | optptr[2] = srrptr+4; | 576 | optptr[2] = srrptr+4; |
578 | } else if (net_ratelimit()) | 577 | } else if (net_ratelimit()) |
579 | printk(KERN_CRIT "ip_forward(): Argh! Destination lost!\n"); | 578 | printk(KERN_CRIT "ip_forward(): Argh! Destination lost!\n"); |