From 5ec8676b281ffc3fefa4044b73e629b10d1df3b7 Mon Sep 17 00:00:00 2001
From: David Bauer <mail@david-bauer.net>
Date: Wed, 14 Jul 2021 01:49:33 +0200
Subject: [PATCH] gluon-core: delete all network device sections (#2263)

Delete all default network device sections upon first boot.

Only LAN & WAN networks are defined at this point. We are using the
legacy way of definiting bridges via the interface sections ifname
option.

The prior filtering was based upon a single device and didn't take into
consideration that DSA interface names can be named arbitrarily.

Signed-off-by: David Bauer <mail@david-bauer.net>
---
 package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces b/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces
index f9ab73c5..afded6f0 100755
--- a/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces
+++ b/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces
@@ -79,9 +79,7 @@ uci:delete('network', 'lan')
 uci:delete('network', 'wan')
 
 uci:foreach('network', 'device', function(dev)
-	if dev['type'] ~= 'bridge' then return end
-	if dev['ifname'] ~= 'lan' and dev['ifname'] ~= 'wan' then return end
-
+	-- Delete all default OpenWrt network device sections.
 	uci:delete('network', dev['.name'])
 end)
 
-- 
GitLab