Skip to contentSkip to conversation

ipv6: remove min MTU check for tunnel destinations

PATCH Superseded Ashwanth Goli 2 participants 3 messages Apr 29, 2018 – May 10, 2018

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: remove min MTU check for tunnel destinations

With 749439bfac "fix udpv6 sendmsg crash caused by too small MTU" tunnel dst's that report a MTU less than IPV6_MIN_MTU are broken even for packets that are smaller than IPV6_MIN_MTU.

According to rfc2473#section-7.1

if the original IPv6 packet is equal or smaller than the IPv6 minimum link MTU, the tunnel entry-point node encapsulates the original packet, and subsequently fragments the resulting IPv6 tunnel packet into IPv6 fragments that do not exceed the Path MTU to the tunnel exit-point.

This patch drops the MTU check for tunnel destinations.

---
 net/ipv6/ip6_output.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ip6_output.c +1 -1
index 2e891d2..c4c3313 100644
@@ -1235,7 +1235,7 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork,
 		if (np->frag_size)
 			mtu = np->frag_size;
 	}
-	if (mtu < IPV6_MIN_MTU)
+	if (!(rt->dst.flags & DST_XFRM_TUNNEL) && mtu < IPV6_MIN_MTU)
 		return -EINVAL;
 	cork->base.fragsize = mtu;
 	if (dst_allfrag(xfrm_dst_path(&rt->dst)))
Signature · 1 line
1.9.1
maintainer
#1 lore raw

From: Ashwanth Goli <[email protected]>
Date: Mon, 30 Apr 2018 00:36:47 +0530

Quoted 13 lines

With 749439bfac "fix udpv6 sendmsg crash caused by too small MTU" tunnel dst's that report a MTU less than IPV6_MIN_MTU are broken even for packets that are smaller than IPV6_MIN_MTU.

According to rfc2473#section-7.1

if the original IPv6 packet is equal or smaller than the IPv6 minimum link MTU, the tunnel entry-point node encapsulates the original packet, and subsequently fragments the resulting IPv6 tunnel packet into IPv6 fragments that do not exceed the Path MTU to the tunnel exit-point.

Quoted 3 lines

This patch drops the MTU check for tunnel destinations.

RFC 2473 is generally about ipv6 tunnels....

net/ipv6/ip6_output.c static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork, · line 1239

Quoted 3 lines
net/ipv6/ip6_output.c +1 -1
-	if (mtu < IPV6_MIN_MTU)
+	if (!(rt->dst.flags & DST_XFRM_TUNNEL) && mtu < IPV6_MIN_MTU)
 		return -EINVAL;

But the check you are adding is specifically checking only IPSEC tunnels.

If what you say is true in your commit message, this test must more generally trigger for all ipv6 tunnel types, not just IPSEC ones.

If IPSEC tunnels are being targetting in this patch intentionally, that needs to be explained in the commit message.

#2 lore raw
Quoted 29 lines · David Miller

From: Ashwanth Goli <[email protected]>
Date: Mon, 30 Apr 2018 00:36:47 +0530

Quoted 13 lines

With 749439bfac "fix udpv6 sendmsg crash caused by too small MTU" tunnel dst's that report a MTU less than IPV6_MIN_MTU are broken even for packets that are smaller than IPV6_MIN_MTU.

According to rfc2473#section-7.1

if the original IPv6 packet is equal or smaller than the IPv6 minimum link MTU, the tunnel entry-point node encapsulates the original packet, and subsequently fragments the resulting IPv6 tunnel packet into IPv6 fragments that do not exceed the Path MTU to the tunnel exit-point.

Quoted 3 lines

This patch drops the MTU check for tunnel destinations.

RFC 2473 is generally about ipv6 tunnels....

net/ipv6/ip6_output.c static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork, · line 1239

Quoted 3 lines
net/ipv6/ip6_output.c +1 -1
-	if (mtu < IPV6_MIN_MTU)
+	if (!(rt->dst.flags & DST_XFRM_TUNNEL) && mtu < IPV6_MIN_MTU)
 		return -EINVAL;

But the check you are adding is specifically checking only IPSEC tunnels.

Quoted 6 lines

If what you say is true in your commit message, this test must more generally trigger for all ipv6 tunnel types, not just IPSEC ones.

If IPSEC tunnels are being targetting in this patch intentionally, that needs to be explained in the commit message.

My intention is to fix the issue for IPSEC tunnels. Will resend by changing the commit text.