From: Hannu Nyman Date: Tue, 20 Apr 2021 18:06:42 +0000 (+0300) Subject: luci-mod-network: fix handling of optional RA/NDP options X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=b7dd10da0fcdc9c69857d848ce1d47243998a22c;p=openwrt-luci.git 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 --- 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 4a2e94faf6..580f2885dd 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 @@ -568,7 +568,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'); @@ -577,7 +577,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'); @@ -586,7 +586,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'); @@ -595,7 +594,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'); @@ -604,7 +602,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'); @@ -657,6 +654,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.'));