X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Fsocket.c;h=653853549e45b29627eb5be44c631460679da098;hb=7057e733c1465661c410b65d90e4c5d0939f1617;hp=384ba132b53d2465d147c249e4467dc904e6ba36;hpb=2142af5d472ae35afca3b6b2c0da26974e8b11b3;p=deb_libnfs.git
diff --git a/lib/socket.c b/lib/socket.c
index 384ba13..6538535 100644
--- a/lib/socket.c
+++ b/lib/socket.c
@@ -14,26 +14,35 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see .
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef AROS
+#include "aros_compat.h"
+#endif
+
#ifdef WIN32
#include "win32_compat.h"
#else
-#include
#include
-#include
-#include
#include
#endif/*WIN32*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
+#ifdef HAVE_POLL_H
+#include
#endif
-#ifdef AROS
-#include "aros_compat.h"
+#ifdef HAVE_UNISTD_H
+#include
#endif
-#ifdef HAVE_POLL_H
-#include
+#ifdef HAVE_SYS_IOCTL_H
+#include
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+#include
#endif
#include
@@ -395,8 +404,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);