diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-03-29 16:30:32 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-03-29 16:30:32 +0200 |
commit | f48f9f11e7f6e3d74e2fd4b6b2478e5673f2f459 (patch) | |
tree | fb6a8cac9ee6ea233a90dd8c63a904319581f823 /modules/luci-mod-network | |
parent | b9fad85f2e3fc988528fd326db715719288604ea (diff) |
luci-mod-network: make condition for disabling legacy bridging more specific
Only disable legacy bridging if an existing network.device section with type
bridge is found, ignore non-type sections since those do not declare a
bridge but set attributes on top of an existing one.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-network')
-rw-r--r-- | modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js index cd51a0391c..4eee9f9576 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js @@ -46,11 +46,11 @@ function validateQoSMap(section_id, value) { return true; } -function deviceSectionExists(section_id, devname) { +function deviceSectionExists(section_id, devname, devtype) { var exists = false; uci.sections('network', 'device', function(ss) { - exists = exists || (ss['.name'] != section_id && ss.name == devname /* && !ss.type*/); + exists = exists || (ss['.name'] != section_id && ss.name == devname && (!devtype || devtype == ss.type)); }); return exists; @@ -379,7 +379,7 @@ return baseclass.extend({ gensection = ifc ? 'physical' : 'devgeneral', advsection = ifc ? 'physical' : 'devadvanced', simpledep = ifc ? { type: '', ifname_single: /^[^@]/ } : { type: '' }, - disableLegacyBridging = isIface && deviceSectionExists(null, 'br-%s'.format(ifc.getName())), + disableLegacyBridging = isIface && deviceSectionExists(null, 'br-%s'.format(ifc.getName()), 'bridge'), o, ss; /* If an externally configured br-xxx interface already exists, |