libs/core: fix lookups bridge interface -> network in luci.model.network
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 6 Feb 2011 04:12:41 +0000 (04:12 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 6 Feb 2011 04:12:41 +0000 (04:12 +0000)
libs/core/luasrc/model/network.lua

index 129f70d..68ad04f 100644 (file)
@@ -852,7 +852,9 @@ function interface.get_network(self)
        if not self.network then
                local net
                for _, net in ipairs(_M:get_networks()) do
-                       if net:contains_interface(self.ifname) then
+                       if net:contains_interface(self.ifname) or
+                          net:ifname() == self.ifname
+                       then
                                self.network = net
                                return net
                        end