summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Wei2012-02-09 22:15:25 +0100
committerDavid S. Miller2012-02-10 21:12:12 +0100
commit5dc7883f2a7c25f8df40d7479687153558cd531b (patch)
tree8f105bb70f72675e6bc4e2bc7516856fb21e24c0
parentnetprio_cgroup: fix wrong memory access when NETPRIO_CGROUP=m (diff)
downloadkernel-qcow2-linux-5dc7883f2a7c25f8df40d7479687153558cd531b.tar.gz
kernel-qcow2-linux-5dc7883f2a7c25f8df40d7479687153558cd531b.tar.xz
kernel-qcow2-linux-5dc7883f2a7c25f8df40d7479687153558cd531b.zip
ipv4: Fix wrong order of ip_rt_get_source() and update iph->daddr.
This patch fix a bug which introduced by commit ac8a4810 (ipv4: Save nexthop address of LSRR/SSRR option to IPCB.).In that patch, we saved the nexthop of SRR in ip_option->nexthop and update iph->daddr until we get to ip_forward_options(), but we need to update it before ip_rt_get_source(), otherwise we may get a wrong src. Signed-off-by: Li Wei <lw@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/ip_options.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
index 1e60f7679075..42dd1a90edea 100644
--- a/net/ipv4/ip_options.c
+++ b/net/ipv4/ip_options.c
@@ -573,8 +573,8 @@ void ip_forward_options(struct sk_buff *skb)
}
if (srrptr + 3 <= srrspace) {
opt->is_changed = 1;
- ip_rt_get_source(&optptr[srrptr-1], skb, rt);
ip_hdr(skb)->daddr = opt->nexthop;
+ ip_rt_get_source(&optptr[srrptr-1], skb, rt);
optptr[2] = srrptr+4;
} else if (net_ratelimit())
printk(KERN_CRIT "ip_forward(): Argh! Destination lost!\n");