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

View File

@ -79,9 +79,7 @@ uci:delete('network', 'lan')
uci:delete('network', 'wan') uci:delete('network', 'wan')
uci:foreach('network', 'device', function(dev) uci:foreach('network', 'device', function(dev)
if dev['type'] ~= 'bridge' then return end -- Delete all default OpenWrt network device sections.
if dev['ifname'] ~= 'lan' and dev['ifname'] ~= 'wan' then return end
uci:delete('network', dev['.name']) uci:delete('network', dev['.name'])
end) end)