From c77abb354906250809ebe1b3f4bc4f01f6d2fbfb Mon Sep 17 00:00:00 2001 From: pony1k <84532040+pony1k@users.noreply.github.com> Date: Sun, 5 Jan 2025 10:45:44 +0100 Subject: [PATCH] network: Do not configure protos on DSA ports... ...by default, to avoid configuring switch ports simultaneously for stand-alone mode and bridge mode. 'config net' sections can still be used to configure routing protocols on switch port network devices. --- .../files/usr/lib/lua/lime/network.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/lime-system/files/usr/lib/lua/lime/network.lua b/packages/lime-system/files/usr/lib/lua/lime/network.lua index bcdaf8f03..cc14bae33 100644 --- a/packages/lime-system/files/usr/lib/lua/lime/network.lua +++ b/packages/lime-system/files/usr/lib/lua/lime/network.lua @@ -397,10 +397,18 @@ function network.configure() for _,protoParams in pairs(deviceProtos) do local args = utils.split(protoParams, network.protoParamsSeparator) - if args[1] == "manual" then break end -- If manual is specified do not configure interface - local protoModule = "lime.proto."..args[1] - for k,v in pairs(flags) do args[k] = v end - if utils.isModuleAvailable(protoModule) then + local protoName = args[1] + if protoName == "manual" then break end -- If manual is specified do not configure interface + local protoModule = "lime.proto."..protoName + local needsConfig = utils.isModuleAvailable(protoModule) + if protoName ~= 'lan' and not flags["specific"] then + --! Work around issue 1121. Do not configure any other + --! protocols than lime.proto.lan on dsa devices unless there + --! is a config net section for the device. + needsConfig = needsConfig and not utils.is_dsa(device) + end + if needsConfig then + for k,v in pairs(flags) do args[k] = v end local proto = require(protoModule) xpcall(function() proto.configure(args) ; proto.setup_interface(device, args) end, function(errmsg) print(errmsg) ; print(debug.traceback()) end)