summaryrefslogtreecommitdiffstats
path: root/sys/dev/snc
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2005-02-21 17:30:10 +0000
committermlaier <mlaier@FreeBSD.org>2005-02-21 17:30:10 +0000
commit3f3a242171fb1866a10ff497dfeb3e91fb6afffe (patch)
treeb411da5743b60d64a6053193e14d93c40fcda07f /sys/dev/snc
parent1ad78757045c6d2b934981a758118e91c30d3ccb (diff)
downloadFreeBSD-src-3f3a242171fb1866a10ff497dfeb3e91fb6afffe.zip
FreeBSD-src-3f3a242171fb1866a10ff497dfeb3e91fb6afffe.tar.gz
Only send packet to bpf if we are committed to send it. Previously it was
possible that the same packet would show up multiple times. This poses some constraints on the TBD locking for snc(4) (see comment). Obtained from: DragonFlyBSD Submitted by: Joerg Sonnenberger Reviewed by: rwatson
Diffstat (limited to 'sys/dev/snc')
-rw-r--r--sys/dev/snc/dp83932.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/snc/dp83932.c b/sys/dev/snc/dp83932.c
index 1ffd4f1..9080699 100644
--- a/sys/dev/snc/dp83932.c
+++ b/sys/dev/snc/dp83932.c
@@ -346,12 +346,6 @@ outloop:
M_ASSERTPKTHDR(m);
/*
- * If bpf is listening on this interface, let it
- * see the packet before we commit it to the wire.
- */
- BPF_MTAP(ifp, m);
-
- /*
* If there is nothing in the o/p queue, and there is room in
* the Tx ring, then send the packet directly. Otherwise append
* it to the o/p queue.
@@ -361,6 +355,16 @@ outloop:
return;
}
+ /*
+ * If bpf is listening on this interface, let it see the packet
+ * before we commit it to the wire, but only if we are really
+ * committed to send it.
+ *
+ * XXX: Locking must protect m against premature m_freem() in
+ * sonictxint().
+ */
+ BPF_MTAP(ifp, m);
+
sc->mtd_prev = sc->mtd_free;
sc->mtd_free = mtd_next;
OpenPOWER on IntegriCloud