X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet.c;h=2a072d8094474393aeac59be5f4ce3cd33509912;hb=8dd09568f1604f1ac8cc0d8d5120d986f5654900;hp=30c73d90a647e5df15f589b3304a441391768aa9;hpb=97d492d9e23f43fe4c8a5ca8c95747088cf32f98;p=tinc diff --git a/src/net.c b/src/net.c index 30c73d90..2a072d80 100644 --- a/src/net.c +++ b/src/net.c @@ -1,7 +1,7 @@ /* net.c -- most of the network code - Copyright (C) 1998-2002 Ivo Timmermans , - 2000-2002 Guus Sliepen + Copyright (C) 1998-2002 Ivo Timmermans , + 2000-2002 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: net.c,v 1.35.4.170 2002/04/18 20:09:05 zarq Exp $ + $Id: net.c,v 1.35.4.174 2002/06/21 10:11:12 guus Exp $ */ #include "config.h" @@ -26,8 +26,13 @@ #include #include #include -#ifdef HAVE_LINUX +#ifdef HAVE_NETINET_IN_SYSTM_H + #include +#endif +#ifdef HAVE_NETINET_IP_H #include +#endif +#ifdef HAVE_NETINET_TCP_H #include #endif #include @@ -155,14 +160,15 @@ cp c = (connection_t *)node->data; if(c->status.remove) - connection_del(c); + { + connection_del(c); + if(!connection_tree->head) + purge(); + } else FD_SET(c->socket, fs); } - if(!connection_tree->head) - purge(); - for(i = 0; i < listen_sockets; i++) { FD_SET(listen_socket[i].tcp, fs);