From ff4c722a211596dcfc0af5d8e06ab09a69b5ab01 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 10 Sep 2019 17:05:15 +0200 Subject: [PATCH] luci-base, luci-mod-network: fix bridge state change quirks Fixes: #2997 Signed-off-by: Jo-Philipp Wich (cherry picked from commit fe0e4f8b4d50cb7ce4e65f747d4ed2de6a030b73) --- modules/luci-base/luasrc/model/network.lua | 4 ++-- .../luasrc/model/cbi/admin_network/ifaces.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/luci-base/luasrc/model/network.lua b/modules/luci-base/luasrc/model/network.lua index 840940a9f..ccd2425db 100644 --- a/modules/luci-base/luasrc/model/network.lua +++ b/modules/luci-base/luasrc/model/network.lua @@ -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 diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua index 06bce01fc..6b9a84955 100644 --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua @@ -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 -- 2.25.1