summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-mwan3/luasrc/controller/mwan3.lua
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2018-01-23 17:31:36 +0200
committerGitHub <noreply@github.com>2018-01-23 17:31:36 +0200
commit8f5be58a56dee85189eaf5a3ecb3e73b89d8288d (patch)
tree9e1bcdd144fe95687c4bb2dcfb8b484cb9e90ff2 /applications/luci-app-mwan3/luasrc/controller/mwan3.lua
parent6e4c1ef4864a214d5d86757e9465df7376a04009 (diff)
parentc38117d2ad91fe2a912e1cfcb9949bb20371127d (diff)
Merge pull request #1587 from TDT-AG/pr/20180123-mwan3-fixes
luci-app-mwan3: refactoring continue 3
Diffstat (limited to 'applications/luci-app-mwan3/luasrc/controller/mwan3.lua')
-rw-r--r--applications/luci-app-mwan3/luasrc/controller/mwan3.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua
index cf5708051f..64ee9f548c 100644
--- a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua
+++ b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua
@@ -1,3 +1,7 @@
+-- Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+-- Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+-- Licensed to the public under the GNU General Public License v2.
+
module("luci.controller.mwan3", package.seeall)
sys = require "luci.sys"
@@ -111,11 +115,11 @@ function diagnosticsData(interface, task)
function get_gateway(inteface)
local dump = require("luci.util").ubus("network.interface.%s" % interface, "status", {})
local gateway
- if dump then
+ if dump and dump.route then
local _, route
for _, route in ipairs(dump.route) do
if dump.route[_].target == "0.0.0.0" then
- gateway = dump.route[_].nexthop
+ gateway = dump.route[_].nexthop
end
end
end