From 9b18b1f47d86cafba6d7215e4fe6ff3e6aab133f Mon Sep 17 00:00:00 2001 From: Hartmut Brandt Date: Fri, 25 Jul 2003 06:43:41 +0000 Subject: [PATCH] Hand the packet to bpf not only in the LLC/SNAP case, but for all connections. While this confuses tcpdump, it enables other applications to see and analyze non-IP traffic (signalling, for example). Pointed out by: Vincent Jardin --- sys/netatm/atm_cm.c | 23 ++++++++++++----------- sys/netatm/atm_device.c | 3 +-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/netatm/atm_cm.c b/sys/netatm/atm_cm.c index f21db37214b..8332e83b2be 100644 --- a/sys/netatm/atm_cm.c +++ b/sys/netatm/atm_cm.c @@ -2887,6 +2887,18 @@ atm_cm_cpcs_upper(cmd, tok, arg1, arg2) } } + /* + * Send the packet to the interface's bpf if this + * vc has one. + */ + if (cvp->cvc_vcc != NULL && + cvp->cvc_vcc->vc_nif != NULL) { + struct ifnet *ifp = + (struct ifnet *)cvp->cvc_vcc->vc_nif; + + BPF_MTAP(ifp, m); + } + /* * Locate packet's connection */ @@ -2900,17 +2912,6 @@ atm_cm_cpcs_upper(cmd, tok, arg1, arg2) break; case ATM_ENC_LLC: - /* - * Send the packet to the interface's bpf if this - * vc has one. - */ - if (cvp->cvc_vcc != NULL && - cvp->cvc_vcc->vc_nif != NULL) { - struct ifnet *ifp = - (struct ifnet *)cvp->cvc_vcc->vc_nif; - - BPF_MTAP(ifp, m); - } /* * Find connection with matching LLC header */ diff --git a/sys/netatm/atm_device.c b/sys/netatm/atm_device.c index 34c62539a30..4481a35a511 100644 --- a/sys/netatm/atm_device.c +++ b/sys/netatm/atm_device.c @@ -374,8 +374,7 @@ 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) { + if (cvcp->cvc_vcc != NULL && cvcp->cvc_vcc->vc_nif != NULL) { struct ifnet *ifp = (struct ifnet *)cvcp->cvc_vcc->vc_nif;