luci-mod-network: fix changing ifname in disabled legacy bridge mode
authorJo-Philipp Wich <jo@mein.io>
Mon, 29 Mar 2021 14:33:07 +0000 (16:33 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Thu, 27 May 2021 10:19:05 +0000 (12:19 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 7dde01be3cc197f79bc6812a2c912c1889dbf1ee)

modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js

index 4eee9f9576b36799fd40bdaaa07d55ab75bf1c96..544cad2c75b9549783a60fca9028972d1cb374f1 100644 (file)
@@ -382,16 +382,19 @@ return baseclass.extend({
                    disableLegacyBridging = isIface && deviceSectionExists(null, 'br-%s'.format(ifc.getName()), 'bridge'),
                    o, ss;
 
-               /* If an externally configured br-xxx interface already exists,
-                * then disable legacy bridge configuration */
-               if (disableLegacyBridging) {
-                       o = this.addOption(s, gensection, form.HiddenValue, 'type');
-                       o.cfgvalue = function() { return '' };
-               }
-               else if (isIface) {
+               if (isIface) {
                        var type;
 
-                       type = this.addOption(s, gensection, form.Flag, 'type', _('Bridge interfaces'), _('Creates a bridge over specified interface(s)'));
+                       /* If an externally configured br-xxx interface already exists,
+                        * then disable legacy bridge configuration */
+                       if (disableLegacyBridging) {
+                               type = this.addOption(s, gensection, form.HiddenValue, 'type');
+                               type.cfgvalue = function() { return '' };
+                       }
+                       else {
+                               type = this.addOption(s, gensection, form.Flag, 'type', _('Bridge interfaces'), _('Creates a bridge over specified interface(s)'));
+                       }
+
                        type.modalonly = true;
                        type.disabled = '';
                        type.enabled = 'bridge';