ovpn: set skb->ignore_df = 1 before sending IPv6 packets out
Subsystems (2)
PATCH 1/1 ovpn: set skb->ignore_df = 1 before sending IPv6 packets out
From: Antonio Quartulli <[email protected]...>
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".
--- drivers/net/ovpn/udp.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/ovpn/udp.c +10 -0
@@ -262,6 +262,16 @@ static int ovpn_udp6_output(struct ovpn_peer *peer, struct ovpn_bind *bind,dst_cache_set_ip6 (cache, dst, &fl.saddr); transmit: +/* user IPv6 packets may be larger than the transport interface +* MTU (after encapsulation), however, since they are locally +* generated we should ensure they get fragmented. +* Setting the ignore_df flag to 1 will instruct ip6_fragment() to +* fragment packets if needed. +* +* NOTE: this is not needed for IPv4 because we pass df=0 to +* udp_tunnel_xmit_skb() +*/ + 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.49.0
Hi,
Quoted 7 lines · Antonio Quartulli
From: Antonio Quartulli <[email protected]...>
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".
Quoted 8 lines
To achieve the above, we must set
skb->ignore_df= 1 so thatip6_fragment()can be made aware of this decision.Failing to do so will result in
ip6_fragment()dropping the packet thinking it was "routed".Reported-by Gert Doering <[email protected]...>Signed-off-by Antonio Quartulli <[email protected]...>
Not sure what the protocol is on this - but I can confirm that this fixes the problems I've observed (t_client, IPv6 UDP transport, tun mtu 1500, ping with 3000 byte packets = inside *and* outside fragmentation needed).
Details are in https://github.com/OpenVPN/ovpn-net-next/issues/3.
so:
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]...Hi,
Quoted 7 lines · Antonio Quartulli
From: Antonio Quartulli <[email protected]...>
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".
Quoted 8 lines
To achieve the above, we must set
skb->ignore_df= 1 so thatip6_fragment()can be made aware of this decision.Failing to do so will result in
ip6_fragment()dropping the packet thinking it was "routed".Reported-by Gert Doering <[email protected]...>Signed-off-by Antonio Quartulli <[email protected]...>
Not sure what the protocol is on this - but I can confirm that this fixes the problems I've observed (t_client, IPv6 UDP transport, tun mtu 1500, ping with 3000 byte packets = inside *and* outside fragmentation needed).
Details are in https://github.com/OpenVPN/ovpn-net-next/issues/3.
so:
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]...Hi,
Quoted 4 lines · Gert Doering
so:
Tested-by Gert Doering <[email protected]...>Acked-by Gert Doering <[email protected]...>
Sending your tags this way is definitely the way to go. I'll add them when pushing the patch to my tree.
Thanks!
Signature · 1 line
Antonio Quartulli
Antonio Quartulli
AppliedQuoted 10 lines · Antonio Quartulli
Hi,
Quoted 4 lines · Gert Doering
so:
Tested-by Gert Doering <[email protected]...>Acked-by Gert Doering <[email protected]...>Sending your tags this way is definitely the way to go. I'll add them when pushing the patch to my tree.
Merged to main branch, commit id e2fb21d856f8
Thanks!
Signature · 1 line
Antonio Quartulli