filter to an inet socket and check at various points during the socket life cycle that the filter can or cannot be attached, and that once attached that the right one is attached and that it can be queried.
accept() returns EAGAIN on a non-blocking listen socket. This is the tool I used to check that such a bug was resolved when merging accept() locking.