modules/admin-full: don't count TIME_WAIT connections in luci-bwc
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 13 Mar 2011 17:52:03 +0000 (17:52 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 13 Mar 2011 17:52:03 +0000 (17:52 +0000)
modules/admin-full/src/luci-bwc.c

index 9f1b420..4067c57 100644 (file)
@@ -344,6 +344,9 @@ static int run_daemon(int nofork)
 
                        while (fgets(line, sizeof(line), info))
                        {
 
                        while (fgets(line, sizeof(line), info))
                        {
+                               if (strstr(line, "TIME_WAIT"))
+                                       continue;
+
                                if (sscanf(line, "%*s %*d %s", ifname) || sscanf(line, "%s %*d", ifname))
                                {
                                        if (!strcmp(ifname, "tcp"))
                                if (sscanf(line, "%*s %*d %s", ifname) || sscanf(line, "%s %*d", ifname))
                                {
                                        if (!strcmp(ifname, "tcp"))