diff --git a/src/program/top/top.lua b/src/program/top/top.lua index b76b4cf529..36f31d57c5 100644 --- a/src/program/top/top.lua +++ b/src/program/top/top.lua @@ -73,10 +73,10 @@ end function open_link_counters (counters, tree) -- Unmap and clear existing link counters. - for _, link in ipairs(counters.links) do - for _, counter + for linkspec, _ in pairs(counters.links) do + for _, name in ipairs({"rxpackets", "txpackets", "rxbytes", "txbytes", "txdrop"}) do - shm.unmap(counters.links[counter]) + counter.delete(tree.."/counters/"..linkspec.."/"..name) end end counters.links = {}