platform_kernel-5.15/net/xfrm
Maciej Żenczykowski 8efe85f936 FROMGIT: xfrm: do not set IPv4 DF flag when encapsulating IPv6 frames <= 1280 bytes.
One may want to have DF set on large packets to support discovering
path mtu and limiting the size of generated packets (hence not
setting the XFRM_STATE_NOPMTUDISC tunnel flag), while still
supporting networks that are incapable of carrying even minimal
sized IPv6 frames (post encapsulation).

Having IPv4 Don't Frag bit set on encapsulated IPv6 frames that
are not larger than the minimum IPv6 mtu of 1280 isn't useful,
because the resulting ICMP Fragmentation Required error isn't
actionable (even assuming you receive it) because IPv6 will not
drop it's path mtu below 1280 anyway.  While the IPv4 stack
could prefrag the packets post encap, this requires the ICMP
error to be successfully delivered and causes a loss of the
original IPv6 frame (thus requiring a retransmit and latency
hit).  Luckily with IPv4 if we simply don't set the DF flag,
we'll just make further fragmenting the packets some other
router's problems.

We'll still learn the correct IPv4 path mtu through encapsulation
of larger IPv6 frames.

I'm still not convinced this patch is entirely sufficient to make
everything happy... but I don't see how it could possibly
make things worse.

See also recent:
  4ff2980b6bd2 'xfrm: fix tunnel model fragmentation behavior'
and friends

Cc: Lorenzo Colitti <lorenzo@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Lina Wang <lina.wang@mediatek.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Maciej Zenczykowski <maze@google.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit 6821ad8770340825f17962cf5ef64ebaffee7fd7 https://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec.git master)

Bug: 203183943
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie7701ebc63b1e2a974114538befd278154eb3bc6
2022-06-01 08:52:42 +00:00
..
Kconfig xfrm/compat: Add 32=>64-bit messages translator 2020-09-24 08:53:03 +02:00
Makefile xfrm: Provide API to register translator module 2020-09-24 08:53:03 +02:00
espintcp.c espintcp: restore IP CB before handing the packet to xfrm 2020-08-17 15:58:04 +02:00
xfrm_algo.c ANDROID: net: xfrm: make PF_KEY SHA256 use RFC-compliant truncation. [v2] 2020-08-17 23:20:44 +00:00
xfrm_compat.c xfrm: rate limit SA mapping change message to user space 2022-01-27 11:04:49 +01:00
xfrm_device.c xfrm: enforce validity of offload input flags 2022-03-08 19:12:44 +01:00
xfrm_hash.c
xfrm_hash.h xfrm: add state hashtable keyed by seq 2021-05-14 13:52:01 +02:00
xfrm_inout.h xfrm: move xfrm4_extract_header to common helper 2020-05-06 09:40:08 +02:00
xfrm_input.c xfrm: replay: avoid replay indirection 2021-06-21 09:55:06 +02:00
xfrm_interface.c xfrm: fix tunnel model fragmentation behavior 2022-04-08 14:22:46 +02:00
xfrm_ipcomp.c net: xfrm: Fix end of loop tests for list_for_each_entry 2021-07-26 12:26:28 +02:00
xfrm_output.c FROMGIT: xfrm: do not set IPv4 DF flag when encapsulating IPv6 frames <= 1280 bytes. 2022-06-01 08:52:42 +00:00
xfrm_policy.c xfrm: Check if_id in xfrm_migrate 2022-03-19 13:47:46 +01:00
xfrm_proc.c
xfrm_replay.c xfrm: replay: remove last replay indirection 2021-06-21 09:55:06 +02:00
xfrm_state.c This is the 5.15.30 stable release 2022-03-19 14:36:07 +01:00
xfrm_sysctl.c
xfrm_user.c This is the 5.15.30 stable release 2022-03-19 14:36:07 +01:00