Skip to contentSkip to conversation

Ensure outer IPv6 (proto udp6) packets can be fragmitted on sending.

PATCH In review Gert Doering 1 participant 2 messages Aug 8, 2022 – Aug 18, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Ensure outer IPv6 (proto udp6) packets can be fragmitted on sending.

If the inside packet is fragmented already, Linux kernel hands us packets with skb->ignore_df=0. Since this is applied to the encapsulated packet, the kernel will then refuse to fragment the resulting UDP/IPv6 packet (for IPv4, it seems to look at the actual DF bit, which does not exist for IPv6).

Always set ignore_df=1 in the udp6 output path.

Fixes t_client tests with "ping -s 3000" across UDP6 tunnels.

---
 drivers/net/ovpn-dco/udp.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ovpn-dco/udp.c +3 -0
index 4c54068..9416338 100644
@@ -215,6 +215,9 @@ static int ovpn_udp6_output(struct ovpn_struct *ovpn, struct ovpn_bind *bind,
 	dst_cache_set_ip6(cache, dst, &fl.saddr);
 
 transmit:
+	/* always permit openvpn-created packets to be (outside) fragmented */
+	skb->ignore_df = 1;
+
 	udp_tunnel6_xmit_skb(dst, sk, skb, skb->dev, &fl.saddr, &fl.daddr, 0,
 			     ip6_dst_hoplimit(dst), 0, fl.fl6_sport,
 			     fl.fl6_dport, udp_get_no_check6_tx(sk));
Signature · 1 line
2.25.1
#1 lore raw

Hi,

Quoted 9 lines · Gert Doering

If the inside packet is fragmented already, Linux kernel hands us packets with skb->ignore_df=0. Since this is applied to the encapsulated packet, the kernel will then refuse to fragment the resulting UDP/IPv6 packet (for IPv4, it seems to look at the actual DF bit, which does not exist for IPv6).

Always set ignore_df=1 in the udp6 output path.

Fixes t_client tests with "ping -s 3000" across UDP6 tunnels.

For the sake of the archives, this made it in into the ovpn-dco repo in slightly modified form, as

commit 3ba6c07ababd4d491c77f5327f8105bead6ddccc (HEAD -> master, origin/master, origin/HEAD)

Author: Gert Doering <[email protected]...>
Date:   Mon Aug 8 13:27:38 2022 +0200

ovpn-dco: ensure outer IPv6 (proto udp6) packets can be fragmitted on sending

so, closing on patchwork.

Thanks, Antonio.

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...