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 Somers 1997-05-23 05:22:48 +00:00
parent 6db75539f1
commit c9bf343a4f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=26032

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)