[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z4fvl9Rk1tuD7Oq7@hog>
Date: Wed, 15 Jan 2025 18:25:43 +0100
From: Sabrina Dubroca <sd@...asysnail.net>
To: Antonio Quartulli <antonio@...nvpn.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, Eric Dumazet <edumazet@...gle.com>,
Donald Hunter <donald.hunter@...il.com>,
Shuah Khan <shuah@...nel.org>, ryazanov.s.a@...il.com,
Andrew Lunn <andrew+netdev@...n.ch>,
Simon Horman <horms@...nel.org>, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, Xiao Liang <shaw.leon@...il.com>
Subject: Re: [PATCH net-next v18 12/25] ovpn: implement TCP transport
@maintainers could I get another day or two to poke at the new socket
release mechanism? I haven't had time to look at it in depth yet.
Just a small thing I saw on this patch:
2025-01-13, 10:31:31 +0100, Antonio Quartulli wrote:
> +int ovpn_tcp_socket_attach(struct socket *sock, struct ovpn_peer *peer)
> +{
> + struct strp_callbacks cb = {
> + .rcv_msg = ovpn_tcp_rcv,
> + .parse_msg = ovpn_tcp_parse,
> + };
> + int ret;
> +
> + /* make sure no pre-existing encapsulation handler exists */
> + if (sock->sk->sk_user_data)
> + return -EBUSY;
> +
> + /* only a fully connected socket is expected. Connection should be
> + * handled in userspace
> + */
> + if (sock->sk->sk_state != TCP_ESTABLISHED) {
> + net_err_ratelimited("%s: provided TCP socket is not in ESTABLISHED state: %d\n",
> + netdev_name(peer->ovpn->dev),
> + sock->sk->sk_state);
> + return -EINVAL;
> + }
> +
> + ret = strp_init(&peer->tcp.strp, sock->sk, &cb);
> + if (ret < 0) {
> + DEBUG_NET_WARN_ON_ONCE(1);
> + release_sock(sock->sk);
Leftover from the old locking scheme. Could probably get snipped when
applying if we decide this version is good otherwise.
> + return ret;
> + }
--
Sabrina
Powered by blists - more mailing lists