Skip to content

Commit

Permalink
xfrm: update flowi saddr in icmp_send if unset
Browse files Browse the repository at this point in the history
otherwise xfrm_lookup will fail to find correct policy

Signed-off-by: Ulrich Weber <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Ulrich Weber authored and davem330 committed Nov 16, 2010
1 parent 4c62ab9 commit 7d98ffd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/ipv4/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,9 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
/* No need to clone since we're just using its address. */
rt2 = rt;

if (!fl.nl_u.ip4_u.saddr)
fl.nl_u.ip4_u.saddr = rt->rt_src;

err = xfrm_lookup(net, (struct dst_entry **)&rt, &fl, NULL, 0);
switch (err) {
case 0:
Expand Down

0 comments on commit 7d98ffd

Please sign in to comment.