Try making the initial port used a little more random
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 29 May 2013 00:22:28 +0000 (17:22 -0700)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 29 May 2013 00:22:28 +0000 (17:22 -0700)
lib/socket.c
win32build.bat

index b14231e84129f2d67980a93177e4a415a2023b03..699ed8a8fad0524b653c638ff71f1cf26fe33e13 100644 (file)
@@ -401,8 +401,12 @@ static int rpc_connect_sockaddr_async(struct rpc_context *rpc, struct sockaddr_s
                static int portOfs = 0;
                const int firstPort = 512;      /* >= 512 according to Sun docs */
                const int portCount = IPPORT_RESERVED - firstPort;
-               int startOfs = portOfs, port, rc;
+               int startOfs, port, rc;
 
+               if (portOfs == 0) {
+                       portOfs = time(NULL) % 400;
+               }
+               startOfs = portOfs;
                do {
                        rc = -1;
                        port = htons(firstPort + portOfs);
index 35a3c3011eb1c080bbe2f49069baf069c5768d4f..388f3d305e462433d589d289629901b301f5a72c 100755 (executable)
@@ -65,26 +65,3 @@ cl /I. /Iwin32 /Iinclude/nfsc /Iinclude /Imount /Infs -Zi -Od -DWIN32 -D_WIN32_W
 
 
 
-
-
-
-
-
-.lib mswsock.lib advapi32.lib wsock32.lib advapi32.lib
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-