[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7d00738e-ad12-41e4-a0f8-eebc30c4fcda@openvpn.net>
Date: Thu, 31 Oct 2024 15:30:50 +0100
From: Antonio Quartulli <antonio@...nvpn.net>
To: sd@...asysnail.net
Cc: netdev@...r.kernel.org, Eric Dumazet <edumazet@...gle.com>,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Donald Hunter <donald.hunter@...il.com>, Shuah Khan <shuah@...nel.org>,
ryazanov.s.a@...il.com, Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH net-next v11 12/23] ovpn: implement TCP transport
On 29/10/2024 11:47, Antonio Quartulli wrote:
[...]
> +
> + /* DATA_V2 packets are handled in kernel, the rest goes to user space */
> + if (likely(ovpn_opcode_from_skb(skb, 0) == OVPN_DATA_V2)) {
> + /* hold reference to peer as required by ovpn_recv().
> + *
> + * NOTE: in this context we should already be holding a
> + * reference to this peer, therefore ovpn_peer_hold() is
> + * not expected to fail
> + */
> + if (WARN_ON(!ovpn_peer_hold(peer)))
> + goto err;
> +
> + ovpn_recv(peer, skb);
> + } else {
As pointed out by Sabrina, we are indeed sending DATA_V1 packets to
userspace.
Not a big deal because userspace will likely ignore or drop them.
However, I will change this and mirror what we do for UDP.
Thanks.
Regards,
> + /* The packet size header must be there when sending the packet
> + * to userspace, therefore we put it back
> + */
> + skb_push(skb, 2);
> + ovpn_tcp_to_userspace(peer, strp->sk, skb);
> + }
> +
> + return;
--
Antonio Quartulli
OpenVPN Inc.
Powered by blists - more mailing lists