From af7a61d3a6c7bd6ceef03d4a2ad70b0366ad9d38 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Tue, 20 Apr 2021 21:06:42 +0300 Subject: [PATCH] luci-mod-network: fix handling of optional RA/NDP options Fix the handling of optional IPv6 RA and NDP options that were exposed to LuCI with 504bdb23f Commit 504bdb23f defined them optional but provided default values. Those values might get unnecessarily written to /etc/config dhcp when the the user modifies some other values. Remove the default values, but provide placeholder for some of them. Add the missing optional definition to 'ndproxy_routing'. (It is a flag, so optional default values do not get written to the config file.) Signed-off-by: Hannu Nyman (cherry picked from commit b7dd10da0fcdc9c69857d848ce1d47243998a22c) --- .../luci-static/resources/view/network/interfaces.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 f1e62c13db..8513e91d33 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 @@ -639,7 +639,7 @@ return view.extend({ so = ss.taboption('ipv6', form.Value, 'ra_maxinterval', _('Max RA interval'), _('Maximum time allowed \ between sending unsolicited RA. Default is 600 seconds (600).')); so.optional = true; - so.default = '600'; + so.placeholder = '600'; so.depends('ra', 'server'); so.depends('ra', 'hybrid'); so.depends('ra', 'relay'); @@ -648,7 +648,7 @@ return view.extend({ so = ss.taboption('ipv6', form.Value, 'ra_mininterval', _('Min RA interval'), _('Minimum time allowed \ between sending unsolicited RA. Default is 200 seconds (200).')); so.optional = true; - so.default = '200'; + so.placeholder = '200'; so.depends('ra', 'server'); so.depends('ra', 'hybrid'); so.depends('ra', 'relay'); @@ -657,7 +657,6 @@ return view.extend({ in RA messages. Default is 1800 seconds (1800). \ Max 9000 seconds.')); so.optional = true; - so.default = '1800'; so.depends('ra', 'server'); so.depends('ra', 'hybrid'); so.depends('ra', 'relay'); @@ -666,7 +665,6 @@ return view.extend({ to be published in RA messages. Default is 0 (0).\ Min 1280.')); so.optional = true; - so.default = '0'; so.depends('ra', 'server'); so.depends('ra', 'hybrid'); so.depends('ra', 'relay'); @@ -675,7 +673,6 @@ return view.extend({ to be published in RA messages.
Default is 0 (0), meaning unspecified.\ Max 255.')); so.optional = true; - so.default = '0'; so.depends('ra', 'server'); so.depends('ra', 'hybrid'); so.depends('ra', 'relay'); @@ -728,6 +725,7 @@ return view.extend({ so = ss.taboption('ipv6', form.Flag, 'ndproxy_routing', _('Learn routes from NDP'), _('Default is on.')); so.default = '1'; + so.optional = true; so = ss.taboption('ipv6', form.Flag, 'ndproxy_slave', _('NDP-Proxy slave'), _('Set interface as NDP-Proxy external slave. Default is off.'));