X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=parseiptables.c;h=db984fa923035a878541da78ac597c17f2f11ff4;hb=334291fb74ea2fe31fb39f4ff0249ba4a3c6764d;hp=5a2043f714f55025d92cc300b937f830baee59f8;hpb=139fc8a0a7c49580783fb3c4b8050761e8bf021a;p=svn%2FPrometheus-QoS%2F.git diff --git a/parseiptables.c b/parseiptables.c index 5a2043f..db984fa 100644 --- a/parseiptables.c +++ b/parseiptables.c @@ -21,7 +21,6 @@ void get_traffic_statistics(const char *whichiptables, int ipv6) { char *str,*cmd; int downloadflag = 0; - traffic_detected = 0; textfile(Pipe,str) *line,*lines=NULL; string(str,STRLEN); @@ -81,10 +80,6 @@ void get_traffic_statistics(const char *whichiptables, int ipv6) else { sscanf(ptr,"%Lu",&traffic); - if(traffic) - { - traffic_detected = 1; - } traffic += (1<<19); traffic >>= 20; } @@ -157,6 +152,7 @@ void get_traffic_statistics(const char *whichiptables, int ipv6) printf("(down) "); } + traffic_detected = 1; printf("%s %Lu MB (%ld pkts)\n", ipaddr, traffic, pkts); if_exists(ip, ips, eqi(ip->addr,ipaddr));