X-Git-Url: https://git.harvie.cz/?p=svn%2FPrometheus-QoS%2F.git;a=blobdiff_plain;f=parsehosts.c;fp=parsehosts.c;h=1e8dbe6773502e9b18f580570257cba552fe20df;hp=92ee23ac12dd5442b8b83f8774d4cd9da72a901a;hb=b1a5c8838af8aab2c376bec78cc8a736a9f9c101;hpb=ca6f7e80f4ce05259df01ec965beb7a4907b8540 diff --git a/parsehosts.c b/parsehosts.c index 92ee23a..1e8dbe6 100644 --- a/parsehosts.c +++ b/parsehosts.c @@ -51,7 +51,7 @@ 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) @@ -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;