ovpn: don't drop skb's dst when xmitting packet
Subsystems (2)
PATCH 1/1 ovpn: don't drop skb's dst when xmitting packet
From: Antonio Quartulli <[email protected]...>
When routing a packet to a LAN behind a peer, ovpn need to inspect the route entry that brought there the packet in the first place.
If this packet is truly routable, the route will provide the GW to be used to lookup the VPN peer to send the packet to.
However, the route entry is currently dropped before entering the ovpn xmit function, because the IFF_XMIT_DST_RELEASE priv_flag is set by default.
Clear the IFF_XMIT_DST_RELEASE flag during interface setup to allow the route entry (skb's dst) to survive and thus be inspected by the routing logic.
--- drivers/net/ovpn/main.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ovpn/main.c +5 -0
@@ -157,6 +157,11 @@ static void ovpn_setup(struct net_device *dev) dev->type =ARPHRD_NONE ; dev->flags =IFF_POINTOPOINT |IFF_NOARP ; dev->priv_flags |=IFF_NO_QUEUE ; +/* when routing packet to a LAN behind a client, we rely on the +* route entry that originally brought the packet into ovpn, so +* don't release it +*/ + dev->priv_flags &= ~IFF_XMIT_DST_RELEASE ; dev->lltx = true; dev->features |= feat;
Signature · 1 line
2.49.0
Hi,
Quoted 3 lines · Antonio Quartulli
Clear the
IFF_XMIT_DST_RELEASEflag during interface setup to allow the route entry (skb's dst) to survive and thus be inspected by the routing logic.
Tested, fixes the problem I reported in
https://github.com/OpenVPN/ovpn-net-next/issues/2
... and is also the arguably correct thing to do - packet forwarding resolves a next-hop for us, so we should ensure we see & use it :-)
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]...Antonio Quartulli
AppliedQuoted 9 lines · Gert Doering
Hi,
Quoted 3 lines · Antonio Quartulli
Clear the
IFF_XMIT_DST_RELEASEflag during interface setup to allow the route entry (skb's dst) to survive and thus be inspected by the routing logic.Tested, fixes the problem I reported in
Quoted 8 lines
https://github.com/OpenVPN/ovpn-net-next/issues/2
... and is also the arguably correct thing to do - packet forwarding resolves a next-hop for us, so we should ensure we see & use it :-)
Tested-by Gert Doering <[email protected]...>Acked-by Gert Doering <[email protected]...>
Merged to main branch, commit id 7618f9707173
Thanks!
Signature · 1 line
Antonio Quartulli