Fix getFirstInterfaceId returning different ids

This commit is contained in:
emanuele-f 2018-12-05 11:02:14 +01:00
parent bec67745cf
commit c69c500dd1
2 changed files with 22 additions and 4 deletions

View file

@ -102,13 +102,13 @@ end
-- ##############################################
function getFirstInterfaceId()
local ifnames = interface.getIfNames()
local ifid = interface.getFirstInterfaceId()
for if_id, if_name in pairs(ifnames) do
return tonumber(if_id), if_name
if ifid ~= nil then
return ifid, getInterfaceName(ifid)
end
return -1, "" -- NOTREACHED
return -1, ""
end
-- ##############################################