X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnetutl.c;h=f49178bdfafbc1028314ffe145d02e61d44e51f6;hb=0f2cf48d304e20abb9b3cded2aaa693828c9d412;hp=cc8266d712d51c394b8d8c5c36c5c7609d8b490e;hpb=ee96ccabbbf0180d5631d3c22838456f28ee9c15;p=tinc diff --git a/src/netutl.c b/src/netutl.c index cc8266d7..f49178bd 100644 --- a/src/netutl.c +++ b/src/netutl.c @@ -35,9 +35,12 @@ #include "net.h" #include "netutl.h" +#include "system.h" + /* 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 +48,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; @@ -202,7 +205,7 @@ cp if(!(h = gethostbyname(p))) { - fprintf(stderr, "Error looking up `%s': %s\n", p, sys_errlist[h_errno]); + fprintf(stderr, _("Error looking up `%s': %s\n"), p, sys_errlist[h_errno]); return NULL; } @@ -226,7 +229,7 @@ void dump_conn_list(void) { conn_list_t *p; cp - syslog(LOG_DEBUG, "Connection list:"); + syslog(LOG_DEBUG, _("Connection list:")); for(p = conn_list; p != NULL; p = p->next) {