This commit is contained in:
Steffen Förster 2017-07-19 15:50:26 +00:00 committed by GitHub
commit cda8450872
3 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,4 @@
if need_table('mesh', nil, false) and need_table('mesh.batman_adv', nil, false) then if need_table('mesh', nil, false) and need_table('mesh.batman_adv', nil, false) then
need_number('mesh.batman_adv.gw_sel_class', false) need_number('mesh.batman_adv.gw_sel_class', false)
need_one_of('mesh.batman_adv.routing_algo', {'BATMAN_IV', 'BATMAN_V'}, false)
end end

View File

@ -14,6 +14,12 @@ proto_gluon_bat0_renew() {
local config="$1" local config="$1"
lock /var/lock/gluon_bat0.lock lock /var/lock/gluon_bat0.lock
local routing_algo="$(uci get batman-adv.bat0.routing_algo)"
echo "The algo is set to $routing_algo"
echo $routing_algo > /sys/module/batman_adv/parameters/routing_algo
local ifdump="$(ubus call network.interface dump)" local ifdump="$(ubus call network.interface dump)"

View File

@ -12,12 +12,18 @@ if site.mesh and site.mesh.batman_adv then
gw_sel_class = site.mesh.batman_adv.gw_sel_class gw_sel_class = site.mesh.batman_adv.gw_sel_class
end end
local routing_algo
if site.mesh and site.mesh.batman_adv then
routing_algo = site.mesh.batman_adv.routing_algo
end
uci:delete('batman-adv', 'bat0') uci:delete('batman-adv', 'bat0')
uci:section('batman-adv', 'mesh', 'bat0', { uci:section('batman-adv', 'mesh', 'bat0', {
orig_interval = 5000, orig_interval = 5000,
gw_mode = 'client', gw_mode = 'client',
gw_sel_class = gw_sel_class, gw_sel_class = gw_sel_class,
hop_penalty = 15, hop_penalty = 15,
routing_algo = routing_algo,
multicast_mode = false, multicast_mode = false,
}) })
uci:save('batman-adv') uci:save('batman-adv')