hosts-ping: moving averages added
[svn/Prometheus-QoS/.git] / parsehosts.c
index cbd2d48a1513f94a256d193448d5682a56199405..1e8dbe6773502e9b18f580570257cba552fe20df 100644 (file)
@@ -51,13 +51,13 @@ parse_ip(char *str)
 {\r
  char *ptr, *ipaddr, *ip6range = NULL, *ipname = NULL, *lmsid = NULL;\r
 \r
- if(ip6prefix) /* Try this only if IPv6 subsystem is active...*/\r
+ if(ip6prefix) /* Try this only if IPv6 subsystem is active... */\r
  {\r
   ptr = strstr(str, "::");\r
   if(ptr && ptr-str > 4)\r
   {\r
    ptr -= 4;   \r
-   duplicate(ptr,ip6range);\r
+   duplicate(ptr, ip6range);\r
    ptr = strstr(ip6range, "::");\r
    if(ptr)\r
    {\r
@@ -160,6 +160,7 @@ void parse_hosts(char *hosts)
    if(lastIP6)\r
    {\r
     lastIP6->sharing = substring;\r
+    lastIP6 = NULL;\r
    }\r
    while(*substring and *substring != '\n')\r
    {\r
@@ -174,6 +175,11 @@ void parse_hosts(char *hosts)
    if_exists(keyword,keywords,(substring=strstr(str,keyword->key)))\r
    {\r
     parse_ip(str);\r
+    if(lastIP6)\r
+    {\r
+     lastIP6->sharing = ip->name;\r
+     lastIP6 = NULL;\r
+    }\r
     ip->keyword = keyword;\r
     keyword->ip_count++;\r
     ip->prio = keyword->default_prio;\r
This page took 0.093752 seconds and 4 git commands to generate.