luci: ignore '::1' in realtime connections
authorEric Luehrsen <ericluehrsen@hotmail.com>
Sat, 11 Feb 2017 02:38:00 +0000 (21:38 -0500)
committerHannu Nyman <hannu.nyman@iki.fi>
Mon, 20 Feb 2017 14:47:56 +0000 (16:47 +0200)
luci ignores only 127.0.0.1 in real time connections.
The dnsmasq.init script sets up resolv.conf(s) as such.
With alternate DNS servers configured 'localhost' will
resolve to '127.0.0.1' or '::1'. The connections graph
will spam itself. openwrt/luci#996

Signed-off-by: Eric Luehrsen <ericluehrsen@hotmail.com>
(cherry picked from commit 52771816a03b9250a22a76af77c27704067d07c5)

modules/luci-mod-admin-full/luasrc/view/admin_status/connections.htm
modules/luci-mod-admin-full/src/luci-bwc.c

index 0b2e52e059a3f5664dd73c33d327c8de16297ba9..b7ebc41451f5e21da0aee34bae89a278ad657bdb 100644 (file)
                                                {
                                                        var c  = conn[i];
 
-                                                       if (c.src == '127.0.0.1' && c.dst == '127.0.0.1')
+                                                       if ((c.src == '127.0.0.1' && c.dst == '127.0.0.1')
+                                                       || (c.src == '::1' && c.dst == '::1'))
                                                                continue;
 
                                                        var tr = conn_table.rows[0].parentNode.insertRow(-1);
index 63668d42b3f3d0e60b45bec58bfe72491a196bca..8ddd91727a6597473d063d6b5ad726873d6905b9 100644 (file)
@@ -521,8 +521,8 @@ static int run_daemon(void)
                                if (strstr(line, "TIME_WAIT"))
                                        continue;
 
-                               if (strstr(line, "src=127.0.0.1 ") &&
-                                   strstr(line, "dst=127.0.0.1 "))
+                               if ((strstr(line, "src=127.0.0.1 ") && strstr(line, "dst=127.0.0.1 ")) 
+                               || (strstr(line, "src=::1 ") && strstr(line, "dst=::1 ")))
                                        continue;
 
                                if (sscanf(line, "%*s %*d %s", ifname) || sscanf(line, "%s %*d", ifname))