Gleb Smirnoff 4c506522c1 When removing ifnets, we should first remove the reference to ifnet
from the interface index, then decrease refcount, not vice versa.

Otherwise there is a race (reproducible) when if_free_internal()
contests on IFNET_WLOCK(), and we got a zero-refed ifnet in the
index for a long time. It may be picked by some other thread,
that runs ifnet_byindex_ref(), who takes the ifnet from index,
and bumps refcount. When reader drops the lock, if_free_internal()
proceeds with free. Then reader tries to free it a second time.
2011-04-04 07:45:08 +00:00
..
2011-03-17 00:29:53 +00:00
2011-02-21 09:01:34 +00:00
2011-04-02 15:02:42 +00:00
2011-04-02 09:46:09 +00:00
2010-12-05 10:15:23 +00:00
2011-03-16 16:44:08 +00:00