diff options
author | Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> | 2009-12-24 21:34:52 +0000 |
---|---|---|
committer | Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> | 2009-12-24 21:34:52 +0000 |
commit | f790aae15a343a99bedf6fa482787d2c311af90d (patch) | |
tree | 1cb529ba79560018adc039990f9f4e0afeb2e902 /libs/core/luasrc | |
parent | af418dfc1b459ee944b67cb8dcfa9a78c573e682 (diff) |
libs/core: Fix wireless network ids
Diffstat (limited to 'libs/core/luasrc')
-rw-r--r-- | libs/core/luasrc/model/wireless.lua | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libs/core/luasrc/model/wireless.lua b/libs/core/luasrc/model/wireless.lua index 6c6467fd4..3d4b2b0a3 100644 --- a/libs/core/luasrc/model/wireless.lua +++ b/libs/core/luasrc/model/wireless.lua @@ -232,12 +232,6 @@ network:property("network") function network._init(self, sid) 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") or ub.uci:get("wireless", sid, "device") @@ -245,13 +239,19 @@ function network._init(self, sid) or parent_dev if dev then - self.id = "%s.network%d" %{ parent_dev, count } - - local wtype = iwi.type(dev) - if dev and wtype then - self.winfo = iwi[wtype] - self.wdev = dev - end + ub.uci:foreach("wireless", "wifi-iface", + function(s) + count = count + 1 + if s['.name'] == sid then + self.id = "%s.network%d" %{ parent_dev, count } + + local wtype = iwi.type(dev) + if dev and wtype then + self.winfo = iwi[wtype] + self.wdev = dev + end + end + end) end end |