gluon-core: create disabled mesh interface sections in outdoor mode

The interfaces should always exist and just be disabled when outdoor
mode is enabled. Not creating them at all leads to an issue in the
advanced wifi settings where an additional reload of the page is
necessary after enabling or disabling the ourdoor mode to make the mesh
VIF options appear or disappear.
This commit is contained in:
Matthias Schiffer 2020-06-06 16:30:38 +02:00
parent d012d7d32f
commit b15b008e69
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C

View File

@ -162,12 +162,13 @@ local function fixup_wan(radio, index)
uci:set('wireless', name, 'macaddr', macaddr) uci:set('wireless', name, 'macaddr', macaddr)
end end
local function configure_mesh_wireless(radio, index, config) local function configure_mesh_wireless(radio, index, config, disabled)
local radio_name = radio['.name'] local radio_name = radio['.name']
local suffix = radio_name:match('^radio(%d+)$') local suffix = radio_name:match('^radio(%d+)$')
configure_mesh(config.mesh(), radio, index, suffix, configure_mesh(config.mesh(), radio, index, suffix,
first_non_nil( first_non_nil(
disabled,
is_disabled('mesh_' .. radio_name), is_disabled('mesh_' .. radio_name),
config.mesh.disabled(false) config.mesh.disabled(false)
) )
@ -215,7 +216,7 @@ wireless.foreach_radio(uci, function(radio, index, config)
util.add_to_set(hostapd_options, 'country3=0x4f') util.add_to_set(hostapd_options, 'country3=0x4f')
uci:set_list('wireless', radio_name, 'hostapd_options', hostapd_options) uci:set_list('wireless', radio_name, 'hostapd_options', hostapd_options)
uci:delete('wireless', 'mesh_' .. radio_name) configure_mesh_wireless(radio, index, config, true)
else else
uci:delete('wireless', radio_name, 'channels') uci:delete('wireless', radio_name, 'channels')