Skip to content

Commit

Permalink
libs/core: fix various problems in the network model
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.luci.subsignal.org/luci/trunk@8705 ab181a69-ba2e-0410-a84d-ff88ab4c47bc
  • Loading branch information
jow committed Jun 17, 2012
1 parent 603f634 commit 62918d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libs/core/luasrc/model/network.lua
Expand Up @@ -633,6 +633,7 @@ function protocol.ifname(self)
ifname = self:_ubus("device")
end
if not ifname then
local num = { }
_uci_real:foreach("wireless", "wifi-iface",
function(s)
if s.device then
Expand Down Expand Up @@ -731,7 +732,7 @@ end

function protocol.gw6addr(self)
local _, route
for _, route in ipairs(self:_ubus("route")) do
for _, route in ipairs(self:_ubus("route") or { }) do
if route.target == "::" and route.mask == 0 then
return ipc.IPv6(route.nexthop):string()
end
Expand All @@ -741,7 +742,7 @@ end
function protocol.dns6addrs(self)
local dns = { }
local _, addr
for _, addr in ipairs(self:_ubus("dns-server")) do
for _, addr in ipairs(self:_ubus("dns-server") or { }) do
if addr:match(":") then
dns[#dns+1] = addr
end
Expand Down Expand Up @@ -1031,6 +1032,7 @@ function interface.ports(self)
for _, iface in ipairs(members) do
ifaces[#ifaces+1] = interface(iface)
end
return ifaces
end
end

Expand Down

0 comments on commit 62918d6

Please sign in to comment.