Skip to content

Commit 7272d4d

Browse files
committed
fix: anygw fails to configure on some dsa devices
some devices using dsa, don't have an bridge called br-lan instead it is present a configuration like ``` config device 'switch' option name 'switch' option type 'bridge' config bridge-vlan 'lan_vlan' option device 'switch' option vlan '1' option ports 'lan1 lan2 lan3 lan4' config interface 'lan' option device 'switch.1' ... ``` utils.lua should then check lan_vlan's device first, or fallback to lan's device anygw.lua should configure it's macvlan on top of the device `switch.1` if present or using the most common 'br-lan' added then a dynamic retrieval of the right device from `network.lan.device` tested on: - dlink,dsl-2750b-b1 (bmips/bcm6328) dsa with switch.1 - tp-link,td-w8968-v3 (bmips/bcm6318) dsa with switch.1 - cudy,wr3000s-v1 (mediatek/filogic) dsa with br-lan
1 parent fa5a22b commit 7272d4d

File tree

2 files changed

+6
-2
lines changed
  • packages
    • lime-proto-anygw/files/usr/lib/lua/lime/proto
    • lime-system/files/usr/lib/lua/lime

2 files changed

+6
-2
lines changed

packages/lime-proto-anygw/files/usr/lib/lua/lime/proto/anygw.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function anygw.configure(args)
3232
local anygw_ipv4 = ipv4:minhost()
3333
anygw_ipv6:prefix(64) -- SLAAC only works with a /64, per RFC
3434
anygw_ipv4:prefix(ipv4:prefix())
35-
local baseIfname = "br-lan"
35+
local baseIfname = config.uci:get('network', 'lan', 'device')
3636
local argsDev = { macaddr = anygw_mac }
3737
local argsIf = {
3838
proto = "static",

packages/lime-system/files/usr/lib/lua/lime/utils.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,11 @@ function utils.find_bridge_cfgid(bridge_name)
635635
end
636636

637637
function utils.find_br_lan()
638-
return utils.find_bridge_cfgid("br-lan")
638+
local dev = config.uci:get('network', 'lan_vlan', 'device')
639+
if dev == nil then
640+
dev = config.uci:get('network', 'lan', 'device')
641+
end
642+
return utils.find_bridge_cfgid(dev)
639643
end
640644

641645
return utils

0 commit comments

Comments
 (0)