X-Git-Url: http://git.harvie.cz/?p=svn%2FPrometheus-QoS%2F.git;a=blobdiff_plain;f=parsehosts.c;h=5014ffb8287cb168d2c6b5df709745ddb25eff7d;hp=ac9b39fd47c374f23c965bb159f3223c2648258c;hb=c38473c17cd984140f177ccb2000089e10444299;hpb=9694a8ec9258e894c4001b076a6c7f6c0e5a46f4 diff --git a/parsehosts.c b/parsehosts.c index ac9b39f..5014ffb 100644 --- a/parsehosts.c +++ b/parsehosts.c @@ -40,6 +40,7 @@ void TheIP(char *ipaddr, int is_network) ip->direct = \ ip->traffic = \ ip->pktsup = \ + ip->pps_limit = \ ip->pktsdown = 0; ip->keyword = keywords; ip->v6 = (strchr(ip->addr,':')!=NULL); @@ -252,12 +253,14 @@ void parse_hosts(char *hosts) else { ip->max -= ip->keyword->reserve_max; - if(ip->maxmin) + if(ip->max < ip->min) { - ip->max=ip->min; + ip->max = ip->min; } } - + + /* MTU is 1450 bytes = 11600 bits ~= 12 kbit, max is in kb/s */ + ip->pps_limit = ip->max/12; ip->mark = FIRSTIPCLASS+1+class_count++; update_network(ip->addr, ip);