X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnetutl.c;h=4d6364ec9f63c6f52fe8d3f09bc0f6cbd631599a;hp=cc8266d712d51c394b8d8c5c36c5c7609d8b490e;hb=028659bfbf164cb7a72831506896e291010b251f;hpb=ee96ccabbbf0180d5631d3c22838456f28ee9c15 diff --git a/src/netutl.c b/src/netutl.c index cc8266d7..4d6364ec 100644 --- a/src/netutl.c +++ b/src/netutl.c @@ -37,7 +37,8 @@ /* look for a connection associated with the given vpn ip, - return its connection structure + return its connection structure. + Skips connections that are not activated! */ conn_list_t *lookup_conn(ip_t ip) { @@ -45,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) + 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)) + if(((ip & p->vpn_mask) == (p->vpn_ip & p->vpn_mask)) && p->status.active) return p; cp return NULL;