X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnetutl.c;h=5b4badfd799d354ac2376774c85cdd3a2759efcd;hp=cc8266d712d51c394b8d8c5c36c5c7609d8b490e;hb=e4ff969a9868ecc25a85daab620f97227de8d493;hpb=4d71de15e8abd137702a5dc04a743d246c3f1110;ds=sidebyside diff --git a/src/netutl.c b/src/netutl.c index cc8266d7..5b4badfd 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->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->active) return p; cp return NULL;