glebius 8c3b1b83f9 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
..
2010-09-16 18:37:33 +00:00
2010-10-29 18:41:09 +00:00
2011-02-21 09:01:34 +00:00
2011-02-11 13:27:00 +00:00
2010-03-01 00:43:05 +00:00
2010-07-15 14:41:59 +00:00
2011-03-20 08:35:00 +00:00
2011-02-11 14:17:58 +00:00