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
This commit is contained in:
parent
93d6cddf05
commit
473156220d
@ -345,12 +345,6 @@ sncstart(ifp)
|
||||
/* We need the header for m_pkthdr.len. */
|
||||
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
|
||||
@ -361,6 +355,16 @@ sncstart(ifp)
|
||||
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user