Open dankamongmen opened 1 year ago
watching strace(), it does seem that we fire off the RTM_GETLINK
message and even get IFLA_STATS64
in response. i bet the issue is that we drop messages for known ifaces, which would have all kinds of problems (won't pick up new MTU, etc.)
it looks like iface_create()
just whips up a new iface for every NEW
message it sees...seriously? indeed, the iface_count
stat goes up by a constant amount each iteration. oy vey!
it looks like in iface_cb()
we replace the existing entry in the nametrie, but we never remove the item from the iface_hash
. we always insert the new iface at the head of the hash chain, so all lookups find the new one. we're of course holding a local reference to the netstack_iface
. so i think what we need do is check for an existing item when we go to add into the name trie, and update that item rather than replacing it? and then free the new item.
we can't just replace the old with the new, because someone might have a handle on it. though how do we handle locking in that case?
despite calling
netstack_refresh_stats()
, subsequent calls tonetstack_iface_stats()
always return the same stats we got when we initialized.