summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorcsjp <csjp@FreeBSD.org>2008-08-01 21:38:46 +0000
committercsjp <csjp@FreeBSD.org>2008-08-01 21:38:46 +0000
commit471e3f43d52a6886559e56d484d07d83a871edb4 (patch)
tree75b49f17a09f9a2f1494e92ce76835b34e6db380 /sys/net
parent635c22c54199c39bc88eebfb4b942bf68245e69f (diff)
downloadFreeBSD-src-471e3f43d52a6886559e56d484d07d83a871edb4.zip
FreeBSD-src-471e3f43d52a6886559e56d484d07d83a871edb4.tar.gz
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
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/bpf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index e11b3e0..f9f3b7d 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -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);
OpenPOWER on IntegriCloud