Commit 7574a3e2 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

Try random port next if a port is taken.

darcs-hash:20051207155652-65a35-5c8c88cf82d9ae999ecc873c40ad131178befa74.gz
parent 2edbd634
......@@ -2050,7 +2050,8 @@ int tport_bind_server(tport_master_t *mr,
tport_zap_primary(*tbf);
if (ephemeral_port != 0 && ephemeral_port != -1) {
if (++p >= 65536) p = 1024;
p += 4025; /* relative prime to 65536 - 1024 */
if (p >= 65536) p -= (65536 - 1024);
if (p == ephemeral_port)
ephemeral_port = 0;
SU_DEBUG_3(("%s(%p): cannot bind all transports to port %s, "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment