- if(c->status.remove) {
- logger(LOG_WARNING, _("Old connection_t for %s (%s) status %04x still lingering, deleting..."),
- c->name, c->hostname, *(uint32_t *)&c->status);
- connection_del(c);
- continue;
- }
- ifdebug(CONNECTIONS) logger(LOG_WARNING, _("Timeout from %s (%s) during authentication"),
- c->name, c->hostname);
- terminate_connection(c, false);
- }
- }
- }
-}
-
-/*
- check all connections to see if anything
- happened on their sockets
-*/
-static void check_network_activity(fd_set * f)
-{
- connection_t *c;
- avl_node_t *node;
- int result, i;
- int len = sizeof(result);
- vpn_packet_t packet;
-
- cp();
-
- if(FD_ISSET(device_fd, f)) {
- if(read_packet(&packet))
- route_outgoing(&packet);
- }
-
- for(node = connection_tree->head; node; node = node->next) {
- c = (connection_t *) node->data;
-
- if(c->status.remove)
- continue;
-
- if(FD_ISSET(c->socket, f)) {
- if(c->status.connecting) {
- c->status.connecting = false;
- getsockopt(c->socket, SOL_SOCKET, SO_ERROR, &result, &len);
-
- if(!result)
- finish_connecting(c);
- else {
- ifdebug(CONNECTIONS) logger(LOG_DEBUG,
- _("Error while connecting to %s (%s): %s"),
- c->name, c->hostname, strerror(result));
+ if(c->status.connecting) {
+ ifdebug(CONNECTIONS)
+ logger(LOG_WARNING, "Timeout while connecting to %s (%s)", c->name, c->hostname);
+ c->status.connecting = false;