diff options
author | jhb <jhb@FreeBSD.org> | 2008-04-05 17:24:44 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-04-05 17:24:44 +0000 |
commit | 5279835925231be63b6bf1dd7219f7b529a5b5e2 (patch) | |
tree | 0fb2c696b95e8c812505b13c427ab0bfe9df9aef | |
parent | 7dac1581a792224d0104ae1ad750fc61cccd9ac8 (diff) | |
download | FreeBSD-src-5279835925231be63b6bf1dd7219f7b529a5b5e2.zip FreeBSD-src-5279835925231be63b6bf1dd7219f7b529a5b5e2.tar.gz |
During attach on some de(4) adapters the driver sends out a test packet as
part of detecting the media. Explicitly ensure that we don't send it to
bpf(4) as bpf(4) isn't setup yet. This worked by accident before the bpf
interface stuff was reworked to avoid other races (bpf_peers_present, etc.)
but now it needs an explicit check to avoid a panic.
MFC after: 3 days
PR: kern/120915
-rw-r--r-- | sys/dev/de/if_de.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index 3503289..81335c1 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -4053,7 +4053,8 @@ tulip_txput(tulip_softc_t * const sc, struct mbuf *m) /* * bounce a copy to the bpf listener, if any. */ - BPF_MTAP(sc->tulip_ifp, m); + if (!(sc->tulip_flags & TULIP_DEVICEPROBE)) + BPF_MTAP(sc->tulip_ifp, m); /* * The descriptors have been filled in. Now get ready @@ -4437,13 +4438,16 @@ tulip_attach(tulip_softc_t * const sc) ifmedia_init(&sc->tulip_ifmedia, 0, tulip_ifmedia_change, tulip_ifmedia_status); - sc->tulip_flags &= ~TULIP_DEVICEPROBE; tulip_ifmedia_add(sc); tulip_reset(sc); TULIP_UNLOCK(sc); ether_ifattach(sc->tulip_ifp, sc->tulip_enaddr); + + TULIP_LOCK(sc); + sc->tulip_flags &= ~TULIP_DEVICEPROBE; + TULIP_UNLOCK(sc); } /* Release memory for a single descriptor ring. */ |