Add SO_REUSEADDR socket opt in case the last telnet

connection is in a time_wait.

Submitted by:	Brian Campbell <brianc@pobox.com>
This commit is contained in:
brian 1997-05-23 05:22:48 +00:00
parent 3f750179f3
commit 4ea4cc4eb3

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: main.c,v 1.53 1997/05/19 03:02:36 brian Exp $
* $Id: main.c,v 1.54 1997/05/23 04:54:03 brian Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@ -429,6 +429,7 @@ char **argv;
ifsin.sin_family = AF_INET;
ifsin.sin_addr.s_addr = INADDR_ANY;
ifsin.sin_port = htons(port);
setsockopt(server, SOL_SOCKET, SO_REUSEADDR, &server, sizeof server);
if (bind(server, (struct sockaddr *) &ifsin, sizeof(ifsin)) < 0) {
perror("bind");
if (errno == EADDRINUSE)