On Tue May 17 08:19:21 2022 +0000, Huw Davies wrote:
Actually, we don't de-populate the list on interface removals, so this should be ok. I'll take another look. (and figure out if there's an equivalent we could do on macOS)
System event sockets (`PF_SYSTEM`, `SYSPROTO_EVENT`) are what you want here. They have the ability to notify the caller when an interface appears (`KEV_DL_IF_ATTACHED`), when it is about to disappear (`KEV_DL_IF_DETACHING`), and when it has vanished (`KEV_DL_IF_DETACHED`).