From 24436414aab60dc84348ec54f23b324b4ae862a3 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 25 Mar 2006 22:41:49 +0000 Subject: allow bpf(4) to ignore packets based on their direction (inbound or outbound), using a new BIOCSDIRFILT ioctl; guidance, feedback and ok canacar@ --- sys/net/if_trunk.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/net/if_trunk.c') diff --git a/sys/net/if_trunk.c b/sys/net/if_trunk.c index 09c042ba43f..3b6c97e6106 100644 --- a/sys/net/if_trunk.c +++ b/sys/net/if_trunk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_trunk.c,v 1.22 2006/03/11 03:12:36 brad Exp $ */ +/* $OpenBSD: if_trunk.c,v 1.23 2006/03/25 22:41:47 djm Exp $ */ /* * Copyright (c) 2005 Reyk Floeter @@ -874,7 +874,7 @@ trunk_start(struct ifnet *ifp) #if NBPFILTER > 0 if (ifp->if_bpf) - bpf_mtap(ifp->if_bpf, m); + bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT); #endif if (tr->tr_proto != TRUNK_PROTO_NONE) @@ -931,7 +931,8 @@ trunk_input(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m) #if NBPFILTER > 0 if (trifp->if_bpf) - bpf_mtap_hdr(trifp->if_bpf, (char *)eh, ETHER_HDR_LEN, m); + bpf_mtap_hdr(trifp->if_bpf, (char *)eh, ETHER_HDR_LEN, m, + BPF_DIRECTION_IN); #endif trifp->if_ipackets++; -- cgit v1.2.3