ovpn: set skb->ignore_df = 1 before sending IPv6 packets out
authorAntonio Quartulli <antonio@openvpn.net>
Mon, 5 May 2025 23:05:01 +0000 (01:05 +0200)
committerAntonio Quartulli <antonio@openvpn.net>
Thu, 15 May 2025 11:09:36 +0000 (13:09 +0200)
commit4e51141f1dce46189b347e59d008b7ca01044bf5
tree9d216c85bbefd302095ac250bcdd946940bd63fd
parent142e17cfb09ec0f1e8f09de25e81061b1b827da4
ovpn: set skb->ignore_df = 1 before sending IPv6 packets out

IPv6 user packets (sent over the tunnel) may be larger than
the outgoing interface MTU after encapsulation.
When this happens ovpn should allow the kernel to fragment
them because they are "locally generated".

To achieve the above, we must set skb->ignore_df = 1
so that ip6_fragment() can be made aware of this decision.

Failing to do so will result in ip6_fragment() dropping
the packet thinking it was "routed".

No change is required in the IPv4 path, because when
calling udp_tunnel_xmit_skb() we already pass the
'df' argument set to 0, therefore the resulting datagram
is allowed to be fragmented if need be.

Fixes: 08857b5ec5d9 ("ovpn: implement basic TX path (UDP)")
Reported-by: Gert Doering <gert@greenie.muc.de>
Closes: https://github.com/OpenVPN/ovpn-net-next/issues/3
Tested-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Gert Doering <gert@greenie.muc.de> # as primary user
Link: https://mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31577.html
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
drivers/net/ovpn/udp.c