From 028659bfbf164cb7a72831506896e291010b251f Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 27 May 2000 19:23:20 +0000 Subject: [PATCH] Fixed typos. When terminating a connection, it's status is not only set to remove=1 but also active=0. --- src/net.c | 1 + src/netutl.c | 4 ++-- src/protocol.c | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/net.c b/src/net.c index 2d16ae83..60b7b792 100644 --- a/src/net.c +++ b/src/net.c @@ -826,6 +826,7 @@ cp syslog(LOG_NOTICE, "Try to re-establish outgoing connection in 5 seconds."); } + cl->status.active = 0; cl->status.remove = 1; cp } diff --git a/src/netutl.c b/src/netutl.c index 5b4badfd..4d6364ec 100644 --- a/src/netutl.c +++ b/src/netutl.c @@ -46,10 +46,10 @@ conn_list_t *lookup_conn(ip_t ip) cp /* Exact match suggested by James B. MacLean */ for(p = conn_list; p != NULL; p = p->next) - if((ip == p->vpn_ip) && p->active) + if((ip == p->vpn_ip) && p->status.active) return p; for(p = conn_list; p != NULL; p = p->next) - if(((ip & p->vpn_mask) == (p->vpn_ip & p->vpn_mask)) && p->active) + if(((ip & p->vpn_mask) == (p->vpn_ip & p->vpn_mask)) && p->status.active) return p; cp return NULL; diff --git a/src/protocol.c b/src/protocol.c index 3b23c9e2..51d95e9d 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -188,7 +188,7 @@ void send_key_changed_all(void) conn_list_t *p; cp for(p = conn_list; p != NULL; p = p->next) - if(p->status.meta && p->active) + if(p->status.meta && p->status.active) send_key_changed(p, myself); cp } @@ -332,7 +332,7 @@ int notify_others(conn_list_t *new, conn_list_t *source, conn_list_t *p; cp for(p = conn_list; p != NULL; p = p->next) - if(p != new && p != source && p->status.meta && p->active) + if(p != new && p != source && p->status.meta && p->status.active) function(p, new); cp return 0; @@ -347,7 +347,7 @@ int notify_one(conn_list_t *new) conn_list_t *p; cp for(p = conn_list; p != NULL; p = p->next) - if(p != new && p->active) + if(p != new && p->status.active) send_add_host(new, p); cp return 0; @@ -453,7 +453,7 @@ cp old connection that has timed out but we don't know it yet. Because our conn_list entry is not active, lookup_conn will skip ourself. */ - if(old=lookup_conn(cl->vpn_ip)) + while(old=lookup_conn(cl->vpn_ip)) terminate_connection(old); cl->status.active = 1; -- 2.20.1