libs/core: Fix wireless network ids
This commit is contained in:
parent
af418dfc1b
commit
f790aae15a
1 changed files with 12 additions and 12 deletions
|
@ -232,12 +232,6 @@ network:property("network")
|
||||||
function network._init(self, sid)
|
function network._init(self, sid)
|
||||||
local count = 0
|
local count = 0
|
||||||
|
|
||||||
ub.uci:foreach("wireless", "wifi-iface",
|
|
||||||
function(s)
|
|
||||||
count = count + 1
|
|
||||||
return s['.name'] ~= sid
|
|
||||||
end)
|
|
||||||
|
|
||||||
local parent_dev = st:get("wireless", sid, "device")
|
local parent_dev = st:get("wireless", sid, "device")
|
||||||
or ub.uci:get("wireless", sid, "device")
|
or ub.uci:get("wireless", sid, "device")
|
||||||
|
|
||||||
|
@ -245,6 +239,10 @@ function network._init(self, sid)
|
||||||
or parent_dev
|
or parent_dev
|
||||||
|
|
||||||
if dev then
|
if dev then
|
||||||
|
ub.uci:foreach("wireless", "wifi-iface",
|
||||||
|
function(s)
|
||||||
|
count = count + 1
|
||||||
|
if s['.name'] == sid then
|
||||||
self.id = "%s.network%d" %{ parent_dev, count }
|
self.id = "%s.network%d" %{ parent_dev, count }
|
||||||
|
|
||||||
local wtype = iwi.type(dev)
|
local wtype = iwi.type(dev)
|
||||||
|
@ -253,6 +251,8 @@ function network._init(self, sid)
|
||||||
self.wdev = dev
|
self.wdev = dev
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function network.name(self)
|
function network.name(self)
|
||||||
|
|
Loading…
Reference in a new issue