luci-mod-network: fix legacy bridge configuration

Ref: https://github.com/openwrt/luci/pull/4307#issuecomment-803432603
Fixes: faad7464a8 ("luci-mod-network: add support for network.device sections")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2021-03-21 00:18:20 +01:00
parent 1c4284150d
commit edf640af58

View file

@ -53,16 +53,6 @@ function deviceSectionExists(section_id, devname) {
exists = exists || (ss['.name'] != section_id && ss.name == devname /* && !ss.type*/);
});
/* Until http://lists.openwrt.org/pipermail/openwrt-devel/2020-July/030397.html lands,
prevent redeclaring interface bridges */
if (!exists) {
var m = devname.match(/^br-([A-Za-z0-9_]+)$/),
s = m ? uci.get('network', m[1]) : null;
if (s && s['.type'] == 'interface' && s.type == 'bridge')
exists = true;
}
return exists;
}