libs/core: fix network is_empty() check for wifi-ifaces which are part of multiple...
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 26 Jun 2012 21:49:24 +0000 (21:49 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 26 Jun 2012 21:49:24 +0000 (21:49 +0000)
libs/core/luasrc/model/network.lua

index d062164..1764a3d 100644 (file)
@@ -782,9 +782,12 @@ function protocol.is_empty(self)
 
                _uci_real:foreach("wireless", "wifi-iface",
                        function(s)
 
                _uci_real:foreach("wireless", "wifi-iface",
                        function(s)
-                               if s.network == self.sid then
-                                       rv = false
-                                       return false
+                               local n
+                               for n in utl.imatch(s.network) do
+                                       if n == self.sid then
+                                               rv = false
+                                               return false
+                                       end
                                end
                        end)
 
                                end
                        end)