X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=parsehosts.c;h=47b06bd5c28925d6495e7ddf20ca6065311a98e4;hb=4deb2d6f2b43232cf5e782ebb1deb9b0e041def9;hp=27d378e9a9fa81b8e8f4d0c4ddc054327ed438fe;hpb=64b2d1255780905c78973df33145c93ee5613c9c;p=svn%2FPrometheus-QoS%2F.git diff --git a/parsehosts.c b/parsehosts.c index 27d378e..47b06bd 100644 --- a/parsehosts.c +++ b/parsehosts.c @@ -25,27 +25,30 @@ void update_network(char *look_for, struct IP* ip); void TheIP(char *ipaddr, int is_network) { create(ip,IP); - ip->name = ""; - ip->addr = ipaddr; - ip->sharing = NULL; - ip->prio = highest_priority+1; - ip->lmsid = -1; - ip->fixedprio = \ - ip->mark = \ - ip->min = \ - ip->max = \ - ip->desired = \ - ip->credit = \ - ip->upload = \ - ip->proxy = \ - ip->direct = \ - ip->traffic = \ - ip->pktsup = \ - ip->pps_limit = \ - ip->pktsdown = 0; - ip->keyword = keywords; - ip->v6 = (strchr(ip->addr,':')!=NULL); - ip->mask = ((ip->v6)?64:32); + ip->name = ""; + ip->addr = ipaddr; + ip->sharing = NULL; + ip->prio = highest_priority+1; + ip->lmsid = -1; + ip->fixedprio = \ + ip->aggregated = \ + ip->mark = \ + ip->min = \ + ip->max = \ + ip->desired = \ + ip->credit = \ + ip->upload = \ + ip->proxy = \ + ip->direct = \ + ip->traffic = \ + ip->traffic_down = \ + ip->traffic_up = \ + ip->pktsup = \ + ip->pps_limit = \ + ip->pktsdown = 0; + ip->keyword = keywords; + ip->v6 = (strchr(ip->addr,':')!=NULL); + ip->mask = ((ip->v6)?64:32); if(is_network) { push(ip, networks); @@ -126,7 +129,7 @@ void parse_and_append_ip(char *str, struct IP *listhead) { concatenate(ip6prefix,ip6range,ptr); ip6range=ptr; - if_exists(ip, ips, eq(ip->addr,ip6range)); + if_exists(ip, ips, eq(ip->addr,ip6range)); /* check - allocated range must be unique */ else { TheIP(ip6range, FALSE); @@ -149,11 +152,7 @@ void parse_and_append_ip(char *str, struct IP *listhead) { concatenate(ip6prefix,ip6uplink,ptr); ip6uplink=ptr; - if_exists(ip, ips, eq(ip->addr,ip6uplink)); - else - { - TheIP(ip6uplink, FALSE); - } + TheIP(ip6uplink, FALSE); /* always new IP - more IPs in single uplink network */ ip->name = ip6uplink; ip->keyword = defaultkeyword; /* settings for default keyword */ if(lmsid)