Fix a race condition in detach path of Ethernet devices. Most current
authorJoerg Sonnenberger <joerg@dragonflybsd.org>
Mon, 8 Nov 2004 10:28:48 +0000 (10:28 +0000)
committerJoerg Sonnenberger <joerg@dragonflybsd.org>
Mon, 8 Nov 2004 10:28:48 +0000 (10:28 +0000)
commit45b8be9e023eb9ee7d8a468a566853a0e457138e
treebe97e3a5ea62c6e3026d1e0e88d60565833e2fb8
parent5845dd65e0039ae771a82338edb41579e55e8f69
Fix a race condition in detach path of Ethernet devices. Most current
drivers do something like this:

XX_stop();
ether_ifdetach();

/* continue and assume device is dead now */

This doesn't work in many cases if a BPF user is left and IFF_PROMISC is
active, because bpfdetach does a reset of the timer for many drivers.
The fix is to move the call to if_down into ether_ifdetach, which gives
the expected behaviour.
sys/net/if_ethersubr.c