Re: [PATCH net 1/2] ovpn: tcp - use cached peer pointer in ovpn_tcp_close()

From: Sabrina Dubroca

Date: Tue May 12 2026 - 10:21:01 EST


2026-05-12, 15:55:39 +0200, Antonio Quartulli wrote:
> Hi,
>
> On 12/05/2026 06:56, David CARLIER wrote:
> > Same multi-read pattern shows up in ovpn_tcp_recvmsg(),
> > ovpn_tcp_sendmsg(), ovpn_tcp_data_ready() and ovpn_tcp_write_space()
> > - happy to roll those into v2 as well, or punt to a follow-up,
> > whichever you'd prefer.
>
> @Eric, if you have no objection, I'd pick this patch up in my tree and let
> David follow with a new patch for net-next.

But this patch is not fixing any problem either, right? Then just wait
until David sends the whole change at once?

And since the "rcu_dereference_sk_user_data + !sock || !sock->peer ||
!ovpn_peer_hold(sock->peer)" pattern is used multiple times, it would
be better to turn it into a helper (ovpn_tcp_get_peer()?). That way
the caller can't be tempted to play with sock->peer.

(also, please wait at least the usual 24 hours before applying)

--
Sabrina