Annotate why we do not call BPF_CHECK_DIRECTION() in this tapping routine.

There is no way for the caller to tell us which direction this packet is
going.  With the bpf_mtap{2} routines, we can check the interface pointer.

MFC after:	2 weeks
This commit is contained in:
Christian S.J. Peron 2008-08-01 21:38:46 +00:00
parent 9b1db80125
commit a05cf8c6db
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=181135

View File

@ -1583,6 +1583,12 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, u_int pktlen)
LIST_FOREACH(d, &bp->bif_dlist, bd_next) {
BPFD_LOCK(d);
++d->bd_rcount;
/*
* NB: We dont call BPF_CHECK_DIRECTION() here since there is no
* way for the caller to indiciate to us whether this packet
* is inbound or outbound. In the bpf_mtap() routines, we use
* the interface pointers on the mbuf to figure it out.
*/
#ifdef BPF_JITTER
if (bpf_jitter_enable != 0 && d->bd_bfilter != NULL)
slen = (*(d->bd_bfilter->func))(pkt, pktlen, pktlen);