All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipv6: remove min MTU check for tunnel destinations
@ 2018-04-29 19:06 Ashwanth Goli
  2018-05-01 16:22 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Ashwanth Goli @ 2018-04-29 19:06 UTC (permalink / raw)
  To: netdev, davem; +Cc: pabeni, dsahern

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.

Signed-off-by: Ashwanth Goli <ashwanth@codeaurora.org>
---
 net/ipv6/ip6_output.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 2e891d2..c4c3313 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -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)))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ipv6: remove min MTU check for tunnel destinations
  2018-04-29 19:06 [PATCH] ipv6: remove min MTU check for tunnel destinations Ashwanth Goli
@ 2018-05-01 16:22 ` David Miller
  2018-05-10 13:47   ` Ashwanth Goli
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2018-05-01 16:22 UTC (permalink / raw)
  To: ashwanth; +Cc: netdev, pabeni, dsahern

From: Ashwanth Goli <ashwanth@codeaurora.org>
Date: Mon, 30 Apr 2018 00:36:47 +0530

> 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.
> 
> Signed-off-by: Ashwanth Goli <ashwanth@codeaurora.org>

RFC 2473 is generally about ipv6 tunnels....

> -	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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ipv6: remove min MTU check for tunnel destinations
  2018-05-01 16:22 ` David Miller
@ 2018-05-10 13:47   ` Ashwanth Goli
  0 siblings, 0 replies; 3+ messages in thread
From: Ashwanth Goli @ 2018-05-10 13:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, pabeni, dsahern, netdev-owner

On 2018-05-01 21:52, David Miller wrote:
> From: Ashwanth Goli <ashwanth@codeaurora.org>
> Date: Mon, 30 Apr 2018 00:36:47 +0530
> 
>> 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.
>> 
>> Signed-off-by: Ashwanth Goli <ashwanth@codeaurora.org>
> 
> RFC 2473 is generally about ipv6 tunnels....
> 
>> -	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.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-10 13:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-29 19:06 [PATCH] ipv6: remove min MTU check for tunnel destinations Ashwanth Goli
2018-05-01 16:22 ` David Miller
2018-05-10 13:47   ` Ashwanth Goli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.