Skip to content

Commit fe833fc

Browse files
klassertdavem330
authored andcommitted
xfrm: fix fragmentation for ipv4 xfrm tunnel
When generating the ip header for the transformed packet we just copy the frag_off field of the ip header from the original packet to the ip header of the new generated packet. If we receive a packet as a chain of fragments, all but the last of the new generated packets have the IP_MF flag set. We have to mask the frag_off field to only keep the IP_DF flag from the original packet. This got lost with git commit 36cf9ac ("[IPSEC]: Separate inner/outer mode processing on output") Signed-off-by: Steffen Klassert <[email protected]> Acked-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a56b8f8 commit fe833fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/xfrm4_mode_tunnel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static int xfrm4_mode_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
5252
IP_ECN_clear(top_iph);
5353

5454
top_iph->frag_off = (flags & XFRM_STATE_NOPMTUDISC) ?
55-
0 : XFRM_MODE_SKB_CB(skb)->frag_off;
55+
0 : (XFRM_MODE_SKB_CB(skb)->frag_off & htons(IP_DF));
5656
ip_select_ident(top_iph, dst->child, NULL);
5757

5858
top_iph->ttl = dst_metric(dst->child, RTAX_HOPLIMIT);

0 commit comments

Comments
 (0)