X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;ds=sidebyside;f=parsehosts.c;h=1e8dbe6773502e9b18f580570257cba552fe20df;hb=e2107a5e5a89245332653d3ac2274b131ab66c60;hp=cbd2d48a1513f94a256d193448d5682a56199405;hpb=14e28c6f75dba715fac299d909fdad50bfcf192d;p=svn%2FPrometheus-QoS%2F.git diff --git a/parsehosts.c b/parsehosts.c index cbd2d48..1e8dbe6 100644 --- a/parsehosts.c +++ b/parsehosts.c @@ -51,13 +51,13 @@ parse_ip(char *str) { char *ptr, *ipaddr, *ip6range = NULL, *ipname = NULL, *lmsid = NULL; - if(ip6prefix) /* Try this only if IPv6 subsystem is active...*/ + if(ip6prefix) /* Try this only if IPv6 subsystem is active... */ { ptr = strstr(str, "::"); if(ptr && ptr-str > 4) { ptr -= 4; - duplicate(ptr,ip6range); + duplicate(ptr, ip6range); ptr = strstr(ip6range, "::"); if(ptr) { @@ -160,6 +160,7 @@ void parse_hosts(char *hosts) if(lastIP6) { lastIP6->sharing = substring; + lastIP6 = NULL; } while(*substring and *substring != '\n') { @@ -174,6 +175,11 @@ void parse_hosts(char *hosts) if_exists(keyword,keywords,(substring=strstr(str,keyword->key))) { parse_ip(str); + if(lastIP6) + { + lastIP6->sharing = ip->name; + lastIP6 = NULL; + } ip->keyword = keyword; keyword->ip_count++; ip->prio = keyword->default_prio;