--- netmist.c 2018-08-23 08:30:44.782779800 -0500 +++ /tmp/netmist.c 2018-10-30 15:13:00.285964052 -0500 @@ -946,7 +946,7 @@ #define HOST_ESEND_PORT (HOST_LIST_PORT+MAXCLIENTS) #define CHILD_ESEND_PORT (HOST_ESEND_PORT+MAXCLIENTS) #define CHILD_LIST_PORT (CHILD_ESEND_PORT+MAXCLIENTS) -#define PORT_RANGE 30000 +#define PORT_RANGE 60000 #define HARD_PORT_RANGE 65536 #define CHILD_STATE_READY 1 @@ -20061,7 +20061,7 @@ if(rc < 0) { tmp_port++; - if(tmp_port > ( (HOST_LIST_PORT + PORT_RANGE) % HARD_PORT_RANGE) ) + if(tmp_port > (HARD_PORT_RANGE-1) ) { if(sockdebug) printf("%s Re-start master init\n",get_timestamp(&time_string[0])); @@ -20418,9 +20418,9 @@ * the rand(). */ netmist_srand((int)time(NULL)+rot++); /* yeah, stir the pot, based on time */ - tmp_port= ( CHILD_ESEND_PORT + ( netmist_rand() % PORT_RANGE ) ) % HARD_PORT_RANGE; + tmp_port= ( HOST_LIST_PORT + ( netmist_rand() % PORT_RANGE ) ) % HARD_PORT_RANGE; #else - tmp_port= CHILD_ESEND_PORT; + tmp_port= HOST_LIST_PORT; #endif if(sockdebug) { @@ -20453,7 +20453,7 @@ if(rc < 0) { tmp_port++; - if(tmp_port > (CHILD_ESEND_PORT + PORT_RANGE) % HARD_PORT_RANGE ) + if(tmp_port > (HARD_PORT_RANGE-1)) { if(sockdebug) { @@ -20813,7 +20813,7 @@ fflush(newstdout); } #endif - tmp_port= CHILD_LIST_PORT+client_id; + tmp_port= HOST_LIST_PORT+client_id; if(ipv6_enable) { memset(&addr6,0, sizeof(struct sockaddr_in6)); @@ -20841,7 +20841,7 @@ if(rc < 0) { tmp_port++; - if(tmp_port > CHILD_LIST_PORT+MAXCLIENTS) + if(tmp_port > (HARD_PORT_RANGE-1)) { if(sockdebug) { @@ -20849,7 +20849,7 @@ fflush(newstdout); } sleep(1); - tmp_port = CHILD_LIST_PORT+client_id; + tmp_port = HOST_LIST_PORT+client_id; } if(ipv6_enable) addr6.sin6_port=htons(tmp_port); @@ -21109,9 +21109,9 @@ #if defined(Windows) || defined(_bsd_) || defined(_solaris_) || defined(_linux_) || defined(WIN32) || defined(_aix_) || defined(_macos_) netmist_srand((int)time(NULL)+rot++); /* yeah, that's ugly */ - tmp_port= ( ( HOST_ESEND_PORT + (netmist_rand() % PORT_RANGE)) % HARD_PORT_RANGE); + tmp_port= ( ( HOST_LIST_PORT + (netmist_rand() % PORT_RANGE)) % HARD_PORT_RANGE); #else - tmp_port=HOST_ESEND_PORT; + tmp_port=HOST_LIST_PORT; #endif if(ipv6_enable) { @@ -21138,7 +21138,7 @@ if(rc < 0) { tmp_port++; - if(tmp_port>(HOST_ESEND_PORT + PORT_RANGE) % HARD_PORT_RANGE) + if(tmp_port > (HARD_PORT_RANGE-1)) { if(sockdebug) printf("%s Master send port restart\n",get_timestamp(&time_string[0]));