hopefuly final IPv6 bugfix
authorxchaos <xchaos@251d49ef-1d17-4917-a970-b30cf55b089b>
Thu, 24 Jan 2013 11:28:30 +0000 (11:28 +0000)
committerxchaos <xchaos@251d49ef-1d17-4917-a970-b30cf55b089b>
Thu, 24 Jan 2013 11:28:30 +0000 (11:28 +0000)
git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@215 251d49ef-1d17-4917-a970-b30cf55b089b

parsehosts.c
prometheus.c

index d37a71657236390195709271a7af41ea61dcdee2..cbd2d48a1513f94a256d193448d5682a56199405 100644 (file)
@@ -41,10 +41,13 @@ void TheIP(char *ipaddr)
  ip->keyword     = keywords;\r
  ip->v6          = (strchr(ip->addr,':')!=NULL);\r
  push(ip,ips);\r
+ ip_count++;\r
 }\r
 \r
+struct IP *lastIP6;\r
+\r
 /* == This function strips extra characters after IPv4 address and stores it = */\r
-void parse_ip(char *str)\r
+parse_ip(char *str)\r
 {\r
  char *ptr, *ipaddr, *ip6range = NULL, *ipname = NULL, *lmsid = NULL;\r
 \r
@@ -104,11 +107,16 @@ void parse_ip(char *str)
    TheIP(ip6range);\r
   }\r
   ip->name = ip6range;\r
-  ip->sharing = ipname;\r
+  ip->keyword = defaultkeyword; /* settings for default keyword */\r
   if(lmsid)\r
   {\r
    ip->lmsid = atoi(lmsid);\r
   }\r
+  lastIP6 = ip;\r
+ }\r
+ else\r
+ {\r
+  lastIP6 = NULL;\r
  }\r
 \r
  if_exists(ip, ips, eq(ip->addr,ipaddr));\r
@@ -147,9 +155,12 @@ void parse_hosts(char *hosts)
   { \r
    substring += 8; /* "sharing-" */\r
    parse_ip(str);\r
-   ip_count++;\r
    ip->sharing = substring;\r
    ip->keyword = defaultkeyword; /* settings for default keyword */\r
+   if(lastIP6)\r
+   {\r
+    lastIP6->sharing = substring;\r
+   }\r
    while(*substring and *substring != '\n')\r
    {\r
     substring++;\r
@@ -163,7 +174,6 @@ void parse_hosts(char *hosts)
    if_exists(keyword,keywords,(substring=strstr(str,keyword->key)))\r
    {\r
     parse_ip(str);\r
-    ip_count++;\r
     ip->keyword = keyword;\r
     keyword->ip_count++;\r
     ip->prio = keyword->default_prio;\r
index fb8fa4a55e47485a6f417d9876d882697fce7ad5..b5f610be06f59aedc3f3370d8abe5ba0a1e78f2e 100644 (file)
@@ -1049,7 +1049,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
  printf("%-22s %-15s mark\n","name","ip");\r
 #endif\r
 \r
- printf("Writing %s ", classmap); \r
+ printf("Writing %s", classmap); \r
  f = fopen(classmap, "w"); \r
  if(f < 0)\r
  {\r
This page took 0.15956 seconds and 4 git commands to generate.