From a0ff929ba8d776b386c8a1405bdb9eb16e608d95 Mon Sep 17 00:00:00 2001
From: Tom Herbers <mail@tomherbers.de>
Date: Wed, 10 Jul 2024 13:31:51 +0200
Subject: [PATCH] gluon-core: fix swconfig detection in ethernet module (#3309)

Switch config for swconfig can be found in the network,
not the system config.

This resulted in `Switch type: none` beeing reported for swconfig devices.

(cherry picked from commit d9cfa194c131452bc4f927076f35a8217dc2a483)
---
 package/gluon-core/luasrc/usr/lib/lua/gluon/ethernet.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/gluon-core/luasrc/usr/lib/lua/gluon/ethernet.lua b/package/gluon-core/luasrc/usr/lib/lua/gluon/ethernet.lua
index cefd12402..49c9217a2 100644
--- a/package/gluon-core/luasrc/usr/lib/lua/gluon/ethernet.lua
+++ b/package/gluon-core/luasrc/usr/lib/lua/gluon/ethernet.lua
@@ -16,11 +16,11 @@ end
 local function is_swconfig()
 	local has = false
 
-	uci:foreach("system", "switch", function()
+	uci:foreach("network", "switch", function()
 		has = true
 	end)
 
-	uci:foreach("system", "switch_vlan", function()
+	uci:foreach("network", "switch_vlan", function()
 		has = true
 	end)
 
-- 
GitLab