libs/sys: make sure to always return a table from arptable() when no callback is passed (#671)
This commit is contained in:
parent
0b5861d6bf
commit
b2d5843ddc
1 changed files with 2 additions and 1 deletions
|
@ -233,7 +233,8 @@ net = {}
|
|||
-- The following fields are defined for arp entry objects:
|
||||
-- { "IP address", "HW address", "HW type", "Flags", "Mask", "Device" }
|
||||
function net.arptable(callback)
|
||||
local arp, e, r, v
|
||||
local arp = (not callback) and {} or nil
|
||||
local e, r, v
|
||||
if fs.access("/proc/net/arp") then
|
||||
for e in io.lines("/proc/net/arp") do
|
||||
local r = { }, v
|
||||
|
|
Loading…
Reference in a new issue