Skip to content

Commit 7e0afbd

Browse files
stefano-garzarelladavem330
authored andcommitted
vsock: fix timeout in vsock_accept()
The accept(2) is an "input" socket interface, so we should use SO_RCVTIMEO instead of SO_SNDTIMEO to set the timeout. So this patch replace sock_sndtimeo() with sock_rcvtimeo() to use the right timeout in the vsock_accept(). Fixes: d021c34 ("VSOCK: Introduce VM Sockets") Signed-off-by: Stefano Garzarella <[email protected]> Reviewed-by: Jorgen Hansen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5b186cd commit 7e0afbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/vmw_vsock/af_vsock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ static int vsock_accept(struct socket *sock, struct socket *newsock, int flags,
14081408
/* Wait for children sockets to appear; these are the new sockets
14091409
* created upon connection establishment.
14101410
*/
1411-
timeout = sock_sndtimeo(listener, flags & O_NONBLOCK);
1411+
timeout = sock_rcvtimeo(listener, flags & O_NONBLOCK);
14121412
prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE);
14131413

14141414
while ((connected = vsock_dequeue_accept(listener)) == NULL &&

0 commit comments

Comments
 (0)