diff options
author | Jo-Philipp Wich <jo@mein.io> | 2023-11-01 00:48:59 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2023-11-01 00:48:59 +0100 |
commit | f105827f42b5e4c02292db4f2537ac9ef3dde204 (patch) | |
tree | 7ce8d75d65f3109f4e28507980b2a478823a7594 /modules/luci-mod-network/htdocs/luci-static | |
parent | da202240bf48e6953fb1ec9f715da1408b734a5c (diff) |
luci-mod-network: relax RA server mode requirements
Allow RA server mode on all but some known incompatible interface protocols.
Fixes: #6667
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-network/htdocs/luci-static')
-rw-r--r-- | modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js | 27 |
1 files changed, 25 insertions, 2 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 b0e4019d57..3748f04b05 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 @@ -740,12 +740,35 @@ return view.extend({ var hybrid_downstream_desc = _('Operate in <em>relay mode</em> if a designated master interface is configured and active, otherwise fall back to <em>server mode</em>.'), ndp_downstream_desc = _('Operate in <em>relay mode</em> if a designated master interface is configured and active, otherwise disable <abbr title="Neighbour Discovery Protocol">NDP</abbr> proxying.'), hybrid_master_desc = _('Operate in <em>relay mode</em> if an upstream IPv6 prefix is present, otherwise disable service.'), + ra_server_allowed = true, checked = this.formvalue(section_id), dhcpv6 = this.section.getOption('dhcpv6').getUIElement(section_id), ndp = this.section.getOption('ndp').getUIElement(section_id), ra = this.section.getOption('ra').getUIElement(section_id); - if (checked == '1' || protoval != 'static') { + /* Assume that serving RAs by default is fine, but disallow it for certain + interface protocols such as DHCP, DHCPv6 or the various PPP flavors. + The intent is to only allow RA serving for interface protocols doing + some kind of static IP config over something resembling a layer 2 + ethernet device. */ + switch (protoval) { + case 'dhcp': + case 'dhcpv6': + case '3g': + case 'l2tp': + case 'ppp': + case 'pppoa': + case 'pppoe': + case 'pptp': + case 'pppossh': + case 'ipip': + case 'gre': + case 'grev6': + ra_server_allowed = false; + break; + } + + if (checked == '1' || !ra_server_allowed) { dhcpv6.node.querySelector('li[data-value="server"]').setAttribute('unselectable', ''); if (dhcpv6.getValue() == 'server') @@ -763,7 +786,7 @@ return view.extend({ ndp.node.querySelector('li[data-value="hybrid"] > div > span').innerHTML = hybrid_master_desc; } else { - if (protoval == 'static') { + if (ra_server_allowed) { dhcpv6.node.querySelector('li[data-value="server"]').removeAttribute('unselectable'); ra.node.querySelector('li[data-value="server"]').removeAttribute('unselectable'); } |