Clear the internal table used by if_get(9) and sleep until all
authormpi <mpi@openbsd.org>
Tue, 30 May 2017 06:42:13 +0000 (06:42 +0000)
committermpi <mpi@openbsd.org>
Tue, 30 May 2017 06:42:13 +0000 (06:42 +0000)
commit563e030e0bfeebeff8d96a7df7fcb228c1de5c40
treed0a69fe21c4a54d1e73b435113210afc525db2bc
parent13739c113ef54cbb80484ba689bb28841a995e92
Clear the internal table used by if_get(9) and sleep until all
remaining ifp references are released *without* the NET_LOCK().

It's safe to do so because the KERNEL_LOCK() serializes accesses
to ``if_map''.

More importantly this fix possible deadlocks between if_get() and
the NET_LOCK().  It is now possible to call them in whatever order.

ok visa@, dlg@
sys/net/if.c