luci-app-mwan3: fix aliased interfaces (@wan6) 1929/head
authorPaul Traina <mail@github.st.pst.org>
Mon, 2 Jul 2018 23:45:10 +0000 (16:45 -0700)
committerPaul Traina <mail@github.st.pst.org>
Mon, 2 Jul 2018 23:45:10 +0000 (16:45 -0700)
applications/luci-app-mwan3/luasrc/controller/mwan3.lua

index 18c2135e4385443cf3941572db70dafe09c69bc2..2d46953e5535052e5c3114a1621567c732da40c8 100644 (file)
@@ -138,10 +138,12 @@ function diagnosticsData(interface, task)
        local number = getInterfaceNumber(interface)
 
        local uci = require "luci.model.uci".cursor(nil, "/var/state")
-       local device = uci:get("network", interface, "ifname")
+       local nw = require "luci.model.network".init()
+       local network = nw:get_network(interface)
+       local device = network and network:ifname()
 
        luci.http.prepare_content("text/plain")
-       if device ~= "" then
+       if device then
                if task == "ping_gateway" then
                        local gateway = get_gateway(interface)
                        if gateway ~= nil then