aboutsummaryrefslogtreecommitdiff
path: root/sys/netatm/atm_device.c
diff options
context:
space:
mode:
authorHartmut Brandt <harti@FreeBSD.org>2003-07-24 08:15:20 +0000
committerHartmut Brandt <harti@FreeBSD.org>2003-07-24 08:15:20 +0000
commit5be9a825e285a775406a93f6ca2c342d8c17655c (patch)
tree5d865fdd2aacd3d8716334448a4da6bb899eafae /sys/netatm/atm_device.c
parentc24297c0f24f91427939d0af43da6d12bceb18b5 (diff)
downloadsrc-5be9a825e285a775406a93f6ca2c342d8c17655c.tar.gz
src-5be9a825e285a775406a93f6ca2c342d8c17655c.zip
Add BPF support to HARP network interfaces. This allows one to see
the traffic on LLC multiplexed connections (like CLIP). PR: kern/51831 Submitted by: Vincent Jardin <vjardin@wanadoo.fr> MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=117960
Diffstat (limited to 'sys/netatm/atm_device.c')
-rw-r--r--sys/netatm/atm_device.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/netatm/atm_device.c b/sys/netatm/atm_device.c
index d3bc45bc61c5..cbfdaa6c8c7d 100644
--- a/sys/netatm/atm_device.c
+++ b/sys/netatm/atm_device.c
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <sys/socketvar.h>
#include <sys/syslog.h>
#include <net/if.h>
+#include <net/bpf.h>
#include <netatm/port.h>
#include <netatm/queue.h>
#include <netatm/atm.h>
@@ -371,6 +372,17 @@ atm_dev_lower(cmd, tok, arg1, arg2)
}
/*
+ * Send the packet to the interface's bpf if this vc has one.
+ */
+ if (cvcp->cvc_conn->co_mpx == ATM_ENC_LLC &&
+ cvcp->cvc_vcc && cvcp->cvc_vcc->vc_nif) {
+ struct ifnet *ifp =
+ (struct ifnet *)cvcp->cvc_vcc->vc_nif;
+
+ BPF_MTAP(ifp, (KBuffer *)arg1);
+ }
+
+ /*
* Hand the data off to the device
*/
(*cup->cu_output)(cup, cvp, (KBuffer *)arg1);