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:20:27 +0000 (17:20 +0200)
Fixes: #2997
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit fe0e4f8b4d50cb7ce4e65f747d4ed2de6a030b73)

modules/luci-base/luasrc/model/network.lua
modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua

index 840940a9fe7a8dd84714b1e2aa1181e695efe6e4..ccd2425db97cb35b8427b2e1451ddc20d8a1dc73 100644 (file)
@@ -1238,8 +1238,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 06bce01fc4459adb2f8696b0e9c67d99424c51d8..6b9a84955301304b77318ce37cb8265240b3d654 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