mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
xfrm: interface: fix ipv4 pmtu check to honor ip header df
[ Upstream commit 8fc0e3b6a8666d656923d214e4dc791e9a17164a ]
Frag needed should only be sent if the header enables DF.
This fix allows packets larger than MTU to pass the xfrm interface
and be fragmented after encapsulation, aligning behavior with
non-interface xfrm.
Fixes: f203b76d78 ("xfrm: Add virtual xfrm interfaces")
Signed-off-by: Eyal Birger <[email protected]>
Reviewed-by: Sabrina Dubroca <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
7977d5fe3d
commit
d78e99dd49
1 changed files with 3 additions and 0 deletions
|
|
@ -302,6 +302,8 @@ xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
|
|||
|
||||
icmpv6_ndo_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
|
||||
} else {
|
||||
if (!(ip_hdr(skb)->frag_off & htons(IP_DF)))
|
||||
goto xmit;
|
||||
icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
|
||||
htonl(mtu));
|
||||
}
|
||||
|
|
@ -310,6 +312,7 @@ xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
|
|||
return -EMSGSIZE;
|
||||
}
|
||||
|
||||
xmit:
|
||||
xfrmi_scrub_packet(skb, !net_eq(xi->net, dev_net(dev)));
|
||||
skb_dst_set(skb, dst);
|
||||
skb->dev = tdev;
|
||||
|
|
|
|||
Loading…
Reference in a new issue