Skip to content
Snippets Groups Projects
Unverified Commit c06bdd6c authored by David Bauer's avatar David Bauer Committed by GitHub
Browse files

gluon-core: only restore WAN proto on upgrade (#2576)


Only restore the netifd proto for the WAN bridge in case the upgrade is
done from an older Gluon version.

For DSL targets, OpenWrt defaults the WAN proto to pppoe, while Gluon
uses the Ethernet ports for WAN. When unconditionally preserving the WAN
proto, pppoe is carried over to Gluon's network config.

Signed-off-by: default avatarDavid Bauer <mail@david-bauer.net>
parent 39f9bf7a
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/lua
local uci = require('simple-uci').cursor()
local sysconfig = require 'gluon.sysconfig'
local util = require 'gluon.util'
local wan = uci:get_all('network_gluon-old', 'wan') or {}
......@@ -13,8 +15,15 @@ uci:section('network', 'interface', 'loopback', {
netmask = '255.0.0.0',
})
local wan_proto = 'dhcp'
if sysconfig.gluon_version and wan.proto ~= nil then
-- Only restore WAN proto in case this is an upgrade
wan_proto = wan.proto
end
uci:section('network', 'interface', 'wan', {
proto = wan.proto or 'dhcp',
proto = wan_proto,
ipaddr = wan.ipaddr,
netmask = wan.netmask,
gateway = wan.gateway,
......
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