浏览代码

[IPSEC]: Fix IP ID selection

I was looking through the xfrm input/output code in order to abstract
out the address family specific encapsulation/decapsulation code.  During
that process I found this bug in the IP ID selection code in xfrm4_output.c.

At that point dst is still the xfrm_dst for the current SA which
represents an internal flow as far as the IPsec tunnel is concerned.
Since the IP ID is going to sit on the outside of the encapsulated
packet, we obviously want the external flow which is just dst->child.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Herbert Xu 19 年之前
父节点
当前提交
a76e07acd0
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/ipv4/xfrm4_output.c

+ 1 - 1
net/ipv4/xfrm4_output.c

@@ -62,7 +62,7 @@ static void xfrm4_encap(struct sk_buff *skb)
 	top_iph->frag_off = (flags & XFRM_STATE_NOPMTUDISC) ?
 	top_iph->frag_off = (flags & XFRM_STATE_NOPMTUDISC) ?
 		0 : (iph->frag_off & htons(IP_DF));
 		0 : (iph->frag_off & htons(IP_DF));
 	if (!top_iph->frag_off)
 	if (!top_iph->frag_off)
-		__ip_select_ident(top_iph, dst, 0);
+		__ip_select_ident(top_iph, dst->child, 0);
 
 
 	top_iph->ttl = dst_metric(dst->child, RTAX_HOPLIMIT);
 	top_iph->ttl = dst_metric(dst->child, RTAX_HOPLIMIT);