libs/core: fix lookups bridge interface -> network in luci.model.network

This commit is contained in:
Jo-Philipp Wich 2011-02-06 04:12:41 +00:00
parent c473bb1d75
commit b818354c94

View 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