Skip to content
Snippets Groups Projects
Unverified Commit c197d028 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 826ac884
No related branches found
No related tags found
No related merge requests found
...@@ -7,20 +7,20 @@ local util = require 'gluon.util' ...@@ -7,20 +7,20 @@ local util = require 'gluon.util'
local uci = require('simple-uci').cursor() local uci = require('simple-uci').cursor()
local gw_sel_class local gw_mode, gw_sel_class, routing_algo
if site.mesh and site.mesh.batman_adv then
gw_sel_class = site.mesh.batman_adv.gw_sel_class gw_mode = uci:get('batman-adv', 'bat0', 'gw_mode') or 'client'
end
local routing_algo
if site.mesh and site.mesh.batman_adv then 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 routing_algo = site.mesh.batman_adv.routing_algo
end 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 = gw_mode,
gw_sel_class = gw_sel_class, gw_sel_class = gw_sel_class,
hop_penalty = 15, hop_penalty = 15,
routing_algo = routing_algo, routing_algo = routing_algo,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment