]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
DGRAM shutdown() on Linux has a bug where if the socket
authorVMware, Inc <>
Tue, 26 Apr 2011 21:15:50 +0000 (14:15 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Tue, 26 Apr 2011 21:15:50 +0000 (14:15 -0700)
is unconnected, it skips waking up the socket.  DGRAM sockets
are hardly ever connected, so this has been fixed.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/modules/linux/vsock/linux/af_vsock.c

index 0bfe3aae0a62004e7deb11618bbc7e8ff2a71e27..97d2805314cae219e8148d5ff0f9b9df5c97e731 100644 (file)
@@ -4140,11 +4140,11 @@ VSockVmciShutdown(struct socket *sock,  // IN
       return -EINVAL;
    }
 
-   if (sock->state == SS_UNCONNECTED) {
+   sk = sock->sk;
+   if (sk->sk_type == SOCK_STREAM && sock->state == SS_UNCONNECTED) {
       return -ENOTCONN;
    }
 
-   sk = sock->sk;
    sock->state = SS_DISCONNECTING;
 
    /* Receive and send shutdowns are treated alike. */