Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09c66295 authored by Jiri Bohac's avatar Jiri Bohac Committed by Sharath Chandra Vurukala
Browse files

Revert "xfrm: xfrm_state_mtu should return at least 1280 for ipv6"

This reverts commit b515d2637276a3810d6595e10ab02c13bfd0b63a.

Commit b515d2637276a3810d6595e10ab02c13bfd0b63a ("xfrm: xfrm_state_mtu
should return at least 1280 for ipv6") in v5.14 breaks the TCP MSS
calculation in ipsec transport mode, resulting complete stalls of TCP
connections. This happens when the (P)MTU is 1280 or slighly larger.

The desired formula for the MSS is:
MSS = (MTU - ESP_overhead) - IP header - TCP header

However, the above commit clamps the (MTU - ESP_overhead) to a
minimum of 1280, turning the formula into
MSS = max(MTU - ESP overhead, 1280) -  IP header - TCP header

With the (P)MTU near 1280, the calculated MSS is too large and the
resulting TCP packets never make it to the destination because they
are over the actual PMTU.

The above commit also causes suboptimal double fragmentation in
xfrm tunnel mode, as described in
https://lore.kernel.org/netdev/20210429202529.codhwpc7w6kbudug@dwarf.suse.cz/



The original problem the above commit was trying to fix is now fixed
by commit 6596a0229541270fb8d38d989f91b78838e5e9da ("xfrm: fix MTU
regression").

Change-Id: Iefabad76eb1870f74b819f45e9d3a51cbc94549c
Signed-off-by: default avatarJiri Bohac <jbohac@suse.cz>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
Git-commit: a6d95c5a628a09be129f25d5663a7e9db8261f51
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git


Signed-off-by: default avatarSharath Chandra <Vurukala&lt;quic_sharathv@quicinc.com>
parent bb300e0c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment