gluon-core: lantiq: use WAN interface from switch0 configuration

On lantiq, the default WAN ifname is 'dsl0' even on devices that have a
separate WAN port. At least on devices using swconfig we can override
this with the switch port labelled as 'wan'.
This commit is contained in:
Matthias Schiffer 2020-06-14 12:43:54 +02:00
parent 5e44f7cdde
commit fa0e2d06b6
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C

View File

@ -45,6 +45,16 @@ if platform.match('ar71xx', 'generic', {
'unifiac-pro',
}) then
lan_ifname, wan_ifname = wan_ifname, lan_ifname
elseif platform.match('lantiq') then
local switch_data = board_data.switch or {}
local switch0_data = switch_data.switch0 or {}
local roles_data = switch0_data.roles or {}
for _, role_data in ipairs(roles_data) do
if role_data.role == 'wan' then
wan_ifname = iface_exists(role_data.device)
break
end
end
end
if wan_ifname and lan_ifname then