diff options
-rw-r--r-- | applications/luci-app-mwan3/luasrc/controller/mwan3.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua index 18c2135e4..2d46953e5 100644 --- a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua +++ b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua @@ -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 |