From fe0e4f8b4d50cb7ce4e65f747d4ed2de6a030b73 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 --- 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 a36a23f32..c8b62f290 100644 --- a/modules/luci-base/luasrc/model/network.lua +++ b/modules/luci-base/luasrc/model/network.lua @@ -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 diff --git a/modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua b/modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua index de7b8676e..3893ddb38 100644 --- a/modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua +++ b/modules/luci-mod-network/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