Add the interface guessing code like there is in perl (#228)

This commit is contained in:
Tim Wilkinson 2022-02-24 09:07:36 -08:00 committed by GitHub
parent 861db07ad6
commit 2bd712cb9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -130,6 +130,20 @@ function hardware.get_iface_name(name)
if intfname then
return intfname
end
-- Now we guess
if name == "lan" then
return "eth0"
end
if name == "wan" then
return "eth0.1"
end
if name == "wifi" then
return "wlan0"
end
if name == "dtdlink" then
return "eth0.2"
end
-- Maybe the board knows
return hardware.get_board().network[name].ifname
end