Skip to content

Commit

Permalink
gluon-mesh-batman-adv: preserve gw_mode on upgrades
Browse files Browse the repository at this point in the history
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
  • Loading branch information
neocturne committed Jul 25, 2017
1 parent 826ac88 commit c197d02
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -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,
Expand Down

0 comments on commit c197d02

Please sign in to comment.