lkml.org 
[lkml]   [2023]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH net-next v3 1/3] vsock: support sockmap
    On Tue, Feb 28, 2023 at 04:36:22PM -0500, Michael S. Tsirkin wrote:
    > On Tue, Feb 28, 2023 at 07:04:34PM +0000, Bobby Eshleman wrote:
    > > @@ -1241,19 +1252,34 @@ static int vsock_dgram_connect(struct socket *sock,
    > >
    > > memcpy(&vsk->remote_addr, remote_addr, sizeof(vsk->remote_addr));
    > > sock->state = SS_CONNECTED;
    > > + sk->sk_state = TCP_ESTABLISHED;
    > >
    > > out:
    > > release_sock(sk);
    > > return err;
    > > }
    >
    >
    > How is this related? Maybe add a comment to explain? Does
    > TCP_ESTABLISHED make sense for all types of sockets?
    >

    Hey Michael, definitely, I can leave a comment.

    The real reason is due to this piece of logic in sockmap:
    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/core/sock_map.c?h=v6.2#n531

    And because of it, you see the same thing in (for example)
    unix_dgram_connect():
    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/unix/af_unix.c?h=v6.2#n1394

    I believe it makes sense for these other socket types.

    \
     
     \ /
      Last update: 2023-03-27 00:39    [W:4.241 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site