Try making the initial port used a little more random
parent
67a9f57e67
commit
cb5b8be2eb
|
@ -401,8 +401,12 @@ static int rpc_connect_sockaddr_async(struct rpc_context *rpc, struct sockaddr_s
|
||||||
static int portOfs = 0;
|
static int portOfs = 0;
|
||||||
const int firstPort = 512; /* >= 512 according to Sun docs */
|
const int firstPort = 512; /* >= 512 according to Sun docs */
|
||||||
const int portCount = IPPORT_RESERVED - firstPort;
|
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 {
|
do {
|
||||||
rc = -1;
|
rc = -1;
|
||||||
port = htons(firstPort + portOfs);
|
port = htons(firstPort + portOfs);
|
||||||
|
|
|
@ -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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue