dankamongmen / libnetstack

Small library around rtnetlink to track networking stack elements
https://nick-black.com/dankwiki/index.php/Libnetstack
Apache License 2.0
10 stars 0 forks source link

Clean up name_trie upon removal of an element #28

Closed dankamongmen closed 5 years ago

dankamongmen commented 5 years ago

When we remove an element from the name_trie (see #13), we just NULL out the reference, possibly leaving a useless tentacle on the trie. Instead, remember the last point of divergence (i.e. the last node to have more than one valid follow pointer, or the initial node), and remove everything back to that point.