* [PATCH] [PATCH net v2] ipv6: remove min MTU check for ipsec tunnels
@ 2018-05-10 17:19 Ashwanth Goli
2018-05-11 9:02 ` Sergei Shtylyov
0 siblings, 1 reply; 5+ messages in thread
From: Ashwanth Goli @ 2018-05-10 17:19 UTC (permalink / raw)
To: netdev, davem; +Cc: pabeni, dsahern, eric.dumazet
With 749439bfac "fix udpv6 sendmsg crash caused by too small MTU"
ipsec tunnels 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.
Dropping the MTU check for ipsec 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] 5+ messages in thread
* Re: [PATCH] [PATCH net v2] ipv6: remove min MTU check for ipsec tunnels
2018-05-10 17:19 [PATCH] [PATCH net v2] ipv6: remove min MTU check for ipsec tunnels Ashwanth Goli
@ 2018-05-11 9:02 ` Sergei Shtylyov
2018-05-11 9:05 ` Sergei Shtylyov
0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2018-05-11 9:02 UTC (permalink / raw)
To: Ashwanth Goli, netdev, davem; +Cc: pabeni, dsahern, eric.dumazet
Hello!
On 5/10/2018 8:19 PM, Ashwanth Goli wrote:
> With 749439bfac "fix udpv6 sendmsg crash caused by too small MTU"
When you cite a comnmit, you must specify at least 12-digit SHA1 and
enclose the summary in (""), not just "".
> ipsec tunnels 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.
>
> Dropping the MTU check for ipsec tunnel destinations.
>
> Signed-off-by: Ashwanth Goli <ashwanth@codeaurora.org>
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [PATCH net v2] ipv6: remove min MTU check for ipsec tunnels
2018-05-11 9:02 ` Sergei Shtylyov
@ 2018-05-11 9:05 ` Sergei Shtylyov
0 siblings, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2018-05-11 9:05 UTC (permalink / raw)
To: Ashwanth Goli, netdev, davem; +Cc: pabeni, dsahern, eric.dumazet
On 5/11/2018 12:02 PM, Sergei Shtylyov wrote:
>> With 749439bfac "fix udpv6 sendmsg crash caused by too small MTU"
>
> When you cite a comnmit, you must specify at least 12-digit SHA1 and
> enclose the summary in (""), not just "".
>
>> ipsec tunnels 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.
>>
>> Dropping the MTU check for ipsec tunnel destinations.
>>
>> Signed-off-by: Ashwanth Goli <ashwanth@codeaurora.org>
> [...]
And you need to specify the patch version change log after the --- tear line.
MBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] [PATCH net v2] ipv6: remove min MTU check for ipsec tunnels
@ 2018-05-10 16:48 Ashwanth Goli
2018-05-10 17:05 ` Eric Dumazet
0 siblings, 1 reply; 5+ messages in thread
From: Ashwanth Goli @ 2018-05-10 16:48 UTC (permalink / raw)
To: netdev, davem; +Cc: pabeni, dsahern
With 749439bfac "fix udpv6 sendmsg crash caused by too small MTU"
ipsec tunnels 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.
Dropping the MTU check for ipsec 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] 5+ messages in thread
* Re: [PATCH] [PATCH net v2] ipv6: remove min MTU check for ipsec tunnels
2018-05-10 16:48 Ashwanth Goli
@ 2018-05-10 17:05 ` Eric Dumazet
0 siblings, 0 replies; 5+ messages in thread
From: Eric Dumazet @ 2018-05-10 17:05 UTC (permalink / raw)
To: Ashwanth Goli, netdev, davem; +Cc: pabeni, dsahern
On 05/10/2018 09:48 AM, Ashwanth Goli wrote:
> With 749439bfac "fix udpv6 sendmsg crash caused by too small MTU"
> ipsec tunnels 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.
>
> Dropping the MTU check for ipsec 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)))
>
Given that the (mtu < IPV6_MIN_MTU) condition is unlikely, I would reorder to :
if (mtu < IPV6_MIN_MTU && !(rt->dst.flags & DST_XFRM_TUNNEL))
return -EINVAL;
The fast path should not look at dst.flags
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-05-11 9:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-10 17:19 [PATCH] [PATCH net v2] ipv6: remove min MTU check for ipsec tunnels Ashwanth Goli
2018-05-11 9:02 ` Sergei Shtylyov
2018-05-11 9:05 ` Sergei Shtylyov
-- strict thread matches above, loose matches on Subject: below --
2018-05-10 16:48 Ashwanth Goli
2018-05-10 17:05 ` Eric Dumazet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).