Skip to content

Commit 5dc7883

Browse files
Li Weidavem330
authored andcommitted
ipv4: Fix wrong order of ip_rt_get_source() and update iph->daddr.
This patch fix a bug which introduced by commit ac8a481 (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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2b73bc6 commit 5dc7883

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/ip_options.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,8 @@ void ip_forward_options(struct sk_buff *skb)
573573
}
574574
if (srrptr + 3 <= srrspace) {
575575
opt->is_changed = 1;
576-
ip_rt_get_source(&optptr[srrptr-1], skb, rt);
577576
ip_hdr(skb)->daddr = opt->nexthop;
577+
ip_rt_get_source(&optptr[srrptr-1], skb, rt);
578578
optptr[2] = srrptr+4;
579579
} else if (net_ratelimit())
580580
printk(KERN_CRIT "ip_forward(): Argh! Destination lost!\n");

0 commit comments

Comments
 (0)