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 <hannu.nyman@iki.fi>
(cherry picked from commit b7dd10da0f)
This commit is contained in:
Hannu Nyman 2021-04-20 21:06:42 +03:00
parent 7d913b9976
commit af7a61d3a6

View file

@ -639,7 +639,7 @@ return view.extend({
so = ss.taboption('ipv6', form.Value, 'ra_maxinterval', _('Max <abbr title="Router Advertisement">RA</abbr> interval'), _('Maximum time allowed \
between sending unsolicited <abbr title="Router Advertisement, ICMPv6 Type 134">RA</abbr>. Default is 600 seconds (<code>600</code>).'));
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 <abbr title="Router Advertisement">RA</abbr> interval'), _('Minimum time allowed \
between sending unsolicited <abbr title="Router Advertisement, ICMPv6 Type 134">RA</abbr>. Default is 200 seconds (<code>200</code>).'));
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 <abbr title="Router Advertisement, ICMPv6 Type 134">RA</abbr> messages. Default is 1800 seconds (<code>1800</code>). \
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 <abbr title="Router Advertisement, ICMPv6 Type 134">RA</abbr> messages. Default is 0 (<code>0</code>).\
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 <abbr title="Router Advertisement">RA</abbr> messages.<br />Default is 0 (<code>0</code>), 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.'));