]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fixed socket timeout issue when we send multiple namespacetool commands.
authorOliver Kurth <okurth@vmware.com>
Fri, 27 Jul 2018 18:46:22 +0000 (11:46 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 27 Jul 2018 18:46:22 +0000 (11:46 -0700)
When namespacetool commands are run without any delay, the second command
may fail because the previous socket connection was not closed.

open-vm-tools/lib/rpcChannel/simpleSocket.c
open-vm-tools/lib/rpcChannel/simpleSocket.h

index 4634137309a8de3e5b5e1459d683553194ee3d50..001fcb4fbc41f44209ba58599be99a941806267a 100644 (file)
@@ -394,6 +394,14 @@ Socket_ConnectVMCI(unsigned int cid,                  // IN
          --localPort;
          continue;
       }
+      if (apiErr == SOCKERR_CONNECT && sysErr == SYSERR_ETIMEDOUT) {
+         /*
+          * ETIMEDOUT on connect due to timeout.
+          * Simply try next port.
+          */
+         --localPort;
+         continue;
+      }
       if (apiErr == SOCKERR_CONNECT && sysErr == SYSERR_EINTR) {
          /*
           * EINTR on connect due to signal.
index a715aefbdc02fe9ca902a8bb3bde19f55bcda3eb..7fe6efbde182d041130e4762ef9f29a1ccbc94d4 100644 (file)
@@ -53,6 +53,7 @@ typedef enum {
 #define SYSERR_EACCESS           WSAEACCES
 #define SYSERR_EINTR             WSAEINTR
 #define SYSERR_ECONNRESET        WSAECONNRESET
+#define SYSERR_ETIMEDOUT         WSAETIMEDOUT
 
 typedef int socklen_t;
 
@@ -62,6 +63,7 @@ typedef int socklen_t;
 #define SYSERR_EACCESS           EACCES
 #define SYSERR_EINTR             EINTR
 #define SYSERR_ECONNRESET        ECONNRESET
+#define SYSERR_ETIMEDOUT         ETIMEDOUT
 
 typedef int SOCKET;
 #define SOCKET_ERROR              (-1)