mesh-batman-adv-core: allow sites to set VLAN for mesh
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
parent
93e48e0a9c
commit
addb4ee7a2
|
@ -7,6 +7,7 @@ for _, config in ipairs({'wifi24', 'wifi5'}) do
|
||||||
need_string(config .. '.mesh_ssid')
|
need_string(config .. '.mesh_ssid')
|
||||||
need_string_match(config .. '.mesh_bssid', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$')
|
need_string_match(config .. '.mesh_bssid', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$')
|
||||||
need_number(config .. '.mesh_mcast_rate')
|
need_number(config .. '.mesh_mcast_rate')
|
||||||
|
need_number(config .. '.mesh_vlan', false)
|
||||||
end
|
end
|
||||||
|
|
||||||
need_boolean('mesh_on_wan', false)
|
need_boolean('mesh_on_wan', false)
|
||||||
|
|
|
@ -27,13 +27,32 @@ local function configure_radio(radio, index, config)
|
||||||
|
|
||||||
local mesh = 'mesh_' .. radio
|
local mesh = 'mesh_' .. radio
|
||||||
uci:delete('network', mesh)
|
uci:delete('network', mesh)
|
||||||
uci:section('network', 'interface', mesh,
|
uci:delete('network', mesh .. '_vlan')
|
||||||
|
|
||||||
|
if config.mesh_vlan then
|
||||||
|
uci:section('network', 'interface', mesh,
|
||||||
|
{
|
||||||
|
proto = 'none',
|
||||||
|
mtu = '1532',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
uci:section('network', 'interface', mesh .. '_vlan',
|
||||||
|
{
|
||||||
|
ifname = '@' .. mesh .. '.' .. config.mesh_vlan,
|
||||||
|
proto = 'batadv',
|
||||||
|
mtu = '1528',
|
||||||
|
mesh = 'bat0',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
else
|
||||||
|
uci:section('network', 'interface', mesh,
|
||||||
{
|
{
|
||||||
proto = 'batadv',
|
proto = 'batadv',
|
||||||
mtu = '1528',
|
mtu = '1528',
|
||||||
mesh = 'bat0',
|
mesh = 'bat0',
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
end
|
||||||
|
|
||||||
uci:delete('wireless', mesh)
|
uci:delete('wireless', mesh)
|
||||||
uci:section('wireless', 'wifi-iface', mesh,
|
uci:section('wireless', 'wifi-iface', mesh,
|
||||||
|
|
Loading…
Reference in New Issue