Always use eth0 address as primary address on x86 and brcm2708

These targets don't have a WLAN adapter by default, so it doesn't make
sense to default to the phy0 address.
remotes/1699402720531464663/tmp_refs/heads/stable
Matthias Schiffer 2015-07-10 20:22:27 +02:00
parent dba25dd496
commit 69c5329bc6
1 changed files with 7 additions and 8 deletions

View File

@ -15,19 +15,18 @@ local util = require 'luci.util'
local try_files = {
'/sys/class/ieee80211/phy0/macaddress',
'/sys/class/net/eth0/address',
'/sys/class/net/eth0/address'
}
if not util.contains({'x86', 'brcm2708'}, platform.get_target()) then
table.insert(try_files, 1, '/sys/class/ieee80211/phy0/macaddress')
end
if platform.match('ar71xx', 'generic', {'tl-wdr3600', 'tl-wdr4300'}) then
table.insert(try_files, 1, '/sys/class/ieee80211/phy1/macaddress')
end
if platform.match('ar71xx', 'generic', {'unifi-outdoor-plus'}) then
elseif platform.match('ar71xx', 'generic', {'unifi-outdoor-plus'}) then
table.insert(try_files, 1, '/sys/class/net/eth0/address')
end
if platform.match('ar71xx', 'generic', {'archer-c5', 'archer-c7'}) then
elseif platform.match('ar71xx', 'generic', {'archer-c5', 'archer-c7'}) then
table.insert(try_files, 1, '/sys/class/net/eth1/address')
end