On Thu, Sep 12, 2013 at 10:19 AM, Mike Belopuhov <m...@belopuhov.com> wrote: ... > either way, we need to move forward on this. we want to use if_index > for the purpose of looking up the interface w/o a pointer to the ifnet.
This sounds like just using a pid to identify processes and hoping they haven't wrapped around...and the places the kernel does that are wrong too**. If pointers are out because refcounting them to avoid dangling pointers leaves them impossible to reliably clean up in bounded time (i.e., you need weak pointers), then there should be a generation number to catch the wraps. IMO. (I don't get why it's useful for tun0-in-layer3 mode to have the same if_index as tun0-in-layer2 mode. The properties are so different that there doesn't really seem to be continuity of identity between them.) Philip Guenther ** yes, fixing ptrace() reparenting back to the original is on my todo list.