luci-base, luci-mod-network: fix bridge state change quirks
authorJo-Philipp Wich <jo@mein.io>
Tue, 10 Sep 2019 15:05:15 +0000 (17:05 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 10 Sep 2019 15:10:36 +0000 (17:10 +0200)
Fixes: #2997
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/luasrc/model/network.lua
modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua

index a36a23f321b25375cbb496c35133e6d65815b3d3..c8b62f29020927b11b38c4d2a7aaaa736c6c9bcf 100644 (file)
@@ -1255,8 +1255,8 @@ function protocol.get_interface(self)
        end
 end
 
-function protocol.get_interfaces(self)
-       if self:is_bridge() or (self:is_virtual() and not self:is_floating()) then
+function protocol.get_interfaces(self, ignore_bridge_state)
+       if ignore_bridge_state or self:is_bridge() or (self:is_virtual() and not self:is_floating()) then
                local ifaces = { }
 
                local ifn
index de7b8676e8f1d83e8da555c32112626f07909d4d..3893ddb383088ded8473e0511f1190fdaa726525 100644 (file)
@@ -305,7 +305,7 @@ if not net:is_floating() then
                if alias then
                        old_ifs[1] = '@' .. alias
                else
-                       for _, i in ipairs(net:get_interfaces() or { net:get_interface() }) do
+                       for _, i in ipairs(net:get_interfaces(true) or { net:get_interface() }) do
                                old_ifs[#old_ifs+1] = i:name()
                        end
                end