From: Jo-Philipp Wich Date: Wed, 27 Apr 2022 10:18:29 +0000 (+0200) Subject: luci-mod-network: avoid needlessly writing `none` RA flags X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f04011f0683dbacb8b831733c708bad760ca61df;p=project%2Fluci.git luci-mod-network: avoid needlessly writing `none` RA flags Fixes: #5725 Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js index f8c7c6a7ff..5b99ae17cd 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js @@ -805,7 +805,14 @@ return view.extend({ return flags.length ? flags : [ 'other-config' ]; }; so.remove = function(section_id) { - uci.set('dhcp', section_id, 'ra_flags', [ 'none' ]); + var existing = L.toArray(uci.get('dhcp', section_id, 'ra_flags')); + if (this.isActive(section_id)) { + if (existing.length != 1 || existing[0] != 'none') + uci.set('dhcp', section_id, 'ra_flags', [ 'none' ]); + } + else if (existing.length) { + uci.unset('dhcp', section_id, 'ra_flags'); + } }; so = ss.taboption('ipv6-ra', form.Value, 'ra_maxinterval', _('Max RA interval'), _('Maximum time allowed between sending unsolicited RA. Default is 600 seconds.'));