* to make the executable able to bind to a system port.
*/
if (1) {
- int port;
+ static int port = 200;
+ int i;
int one = 1;
setsockopt(rpc->fd, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(one));
- for (port = 200; port < 500; port++) {
+ for (i = 0; i < 500; i++) {
struct sockaddr_in sin;
+ if(++port > 700) port = 200;
+
memset(&sin, 0, sizeof(sin));
sin.sin_port = htons(port);
sin.sin_family = AF_INET;