Skip to contentSkip to conversation

xfrm: update flowi saddr in icmp_send if unset

PATCH In review Ulrich Weber 2 participants 2 messages Nov 5, 2010 – Nov 16, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfrm: update flowi saddr in icmp_send if unset

otherwise xfrm_lookup will fail to find correct policy

---
 net/ipv4/icmp.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
net/ipv4/icmp.c +3 -0
index 96bc7f9..e5d1a44 100644
@@ -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:
Signature · 1 line
1.7.1
maintainer
#1 lore raw

From: Ulrich Weber <[email protected]>
Date: Fri, 5 Nov 2010 12:39:12 +0100

Quoted 3 lines

otherwise xfrm_lookup will fail to find correct policy

Looks good, applied to net-2.6

Sorry for taking so long but I wanted to validate this change against how the rest of this code handles source addresses.