modules/admin-full: filter IPv6 linklocal IPs in iface overview
[project/luci.git] / modules / admin-full / luasrc / controller / admin / network.lua
index 6840751..759ad68 100644 (file)
@@ -17,7 +17,6 @@ module("luci.controller.admin.network", package.seeall)
 
 function index()
        local uci = require("luci.model.uci").cursor()
-
        local page
 
        page = node("admin", "network")
@@ -26,7 +25,7 @@ function index()
        page.order  = 50
        page.index  = true
 
-       if page.inreq then
+--     if page.inreq then
                local has_switch = false
 
                uci:foreach("network", "switch",
@@ -155,7 +154,7 @@ function index()
 
                page = entry({"admin", "network", "diag_traceroute"}, call("diag_traceroute"), nil)
                page.leaf = true
-       end
+--     end
 end
 
 function wifi_join()
@@ -217,14 +216,14 @@ function wifi_delete(network)
                local dev = wnet:get_device()
                local net = wnet:get_network()
                if dev then
-                       luci.sys.call("env -i /sbin/wifi down %q" % dev:name())
+                       luci.sys.call("env -i /sbin/wifi down %q >/dev/null" % dev:name())
                        ntm:del_wifinet(network)
                        ntm:commit("wireless")
-                       if net:is_empty() then
+                       if net and net:is_empty() then
                                ntm:del_network(net:name())
                                ntm:commit("network")
                        end
-                       luci.sys.call("env -i /sbin/wifi up %q" % dev:name())
+                       luci.sys.call("env -i /sbin/wifi up %q >/dev/null" % dev:name())
                end
        end
 
@@ -271,11 +270,13 @@ function iface_status()
                                }
                        end
                        for _, a in ipairs(device:ip6addrs()) do
-                               data.ip6addrs[#data.ip6addrs+1] = {
-                                       addr      = a:host():string(),
-                                       netmask   = a:mask():string(),
-                                       prefix    = a:prefix()
-                               }
+                               if not a:is6linklocal() then
+                                       data.ip6addrs[#data.ip6addrs+1] = {
+                                               addr      = a:host():string(),
+                                               netmask   = a:mask():string(),
+                                               prefix    = a:prefix()
+                                       }
+                               end
                        end
 
                        for _, device in ipairs(net:get_interfaces() or {}) do