Skip to content
Snippets Groups Projects
Unverified Commit a76eaa5c authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-mesh-batman-adv: preserve gw_mode on upgrades

When a Gluon node is used to connect to an uplink router/DHCP server (for
example in deployments without VPN tunnels), the gw_mode must be set to
server; this should be preserved on upgrades.

Fixes #1196
parent 582d0961
No related branches found
No related tags found
No related merge requests found
......@@ -7,20 +7,20 @@ local util = require 'gluon.util'
local uci = require('simple-uci').cursor()
local gw_sel_class
if site.mesh and site.mesh.batman_adv then
gw_sel_class = site.mesh.batman_adv.gw_sel_class
end
local gw_mode, gw_sel_class, routing_algo
gw_mode = uci:get('batman-adv', 'bat0', 'gw_mode') or 'client'
local routing_algo
if site.mesh and site.mesh.batman_adv then
gw_sel_class = site.mesh.batman_adv.gw_sel_class
routing_algo = site.mesh.batman_adv.routing_algo
end
uci:delete('batman-adv', 'bat0')
uci:section('batman-adv', 'mesh', 'bat0', {
orig_interval = 5000,
gw_mode = 'client',
gw_mode = gw_mode,
gw_sel_class = gw_sel_class,
hop_penalty = 15,
routing_algo = routing_algo,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment