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>
This commit is contained in:
David Bauer 2021-07-14 01:49:33 +02:00 committed by GitHub
parent 73b0128468
commit 5ec8676b28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -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)