Commit 763fe579c154a7bcff5f40788b3b32ada3a1f8db
Committed by
Greg Kroah-Hartman
1 parent
017d762758
ipv4: Fix wrong order of ip_rt_get_source() and update iph->daddr.
[ Upstream commit 5dc7883f2a7c25f8df40d7479687153558cd531b ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
net/ipv4/ip_options.c
... | ... | @@ -573,8 +573,8 @@ |
573 | 573 | } |
574 | 574 | if (srrptr + 3 <= srrspace) { |
575 | 575 | opt->is_changed = 1; |
576 | - ip_rt_get_source(&optptr[srrptr-1], skb, rt); | |
577 | 576 | ip_hdr(skb)->daddr = opt->nexthop; |
577 | + ip_rt_get_source(&optptr[srrptr-1], skb, rt); | |
578 | 578 | optptr[2] = srrptr+4; |
579 | 579 | } else if (net_ratelimit()) |
580 | 580 | printk(KERN_CRIT "ip_forward(): Argh! Destination lost!\n"); |