diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-01-22 16:36:18 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-01-22 16:36:18 +0100 |
commit | 625a89a37099dbad4af8e3270b21318e81449093 (patch) | |
tree | bb36d05cee6d08417c749b91c2e43df392de38d6 | |
parent | feb576413bd49b54edf90726de650875e180fe30 (diff) |
luci-app-coovachilli: switch to luci.ip route functions
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
-rw-r--r-- | applications/luci-app-coovachilli/luasrc/model/cbi/coovachilli_network.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/applications/luci-app-coovachilli/luasrc/model/cbi/coovachilli_network.lua b/applications/luci-app-coovachilli/luasrc/model/cbi/coovachilli_network.lua index e1a084a98..025bc1795 100644 --- a/applications/luci-app-coovachilli/luasrc/model/cbi/coovachilli_network.lua +++ b/applications/luci-app-coovachilli/luasrc/model/cbi/coovachilli_network.lua @@ -2,8 +2,8 @@ -- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. -require("luci.sys") -require("luci.ip") +local sys = require"luci.sys" +local ip = require "luci.ip" m = Map("coovachilli") @@ -16,8 +16,8 @@ s1:option( Value, "tundev" ).optional = true s1:option( Value, "txqlen" ).optional = true net = s1:option( Value, "net" ) -for _, route in ipairs(luci.sys.net.routes()) do - if route.device ~= "lo" and route.dest:prefix() < 32 then +for _, route in ipairs(ip.routes({ family = 4, type = 1 })) do + if route.dest:prefix() > 0 and route.dest:prefix() < 32 then net:value( route.dest:string() ) end end @@ -41,7 +41,7 @@ s2 = m:section(TypedSection, "dhcp") s2.anonymous = true dif = s2:option( Value, "dhcpif" ) -for _, nif in ipairs(luci.sys.net.devices()) do +for _, nif in ipairs(sys.net.devices()) do if nif ~= "lo" then dif:value(nif) end end |