summaryrefslogtreecommitdiffstats
path: root/sys/dev/ppbus/if_plip.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-12-29 13:59:50 +0000
committerjhb <jhb@FreeBSD.org>2006-12-29 13:59:50 +0000
commit67155fb0b2a1b3d5ee6f59198ae389f826754c66 (patch)
tree5677cbe8565b075c609dc8ea0a6087d8251a7bca /sys/dev/ppbus/if_plip.c
parent89e0ae76db000800f893d800de9dcbf15519ff50 (diff)
downloadFreeBSD-src-67155fb0b2a1b3d5ee6f59198ae389f826754c66.zip
FreeBSD-src-67155fb0b2a1b3d5ee6f59198ae389f826754c66.tar.gz
Various bpf(4) related fixes to catch places up to the new bpf(4)
semantics. - Stop testing bpf pointers for NULL. In some cases use bpf_peers_present() and then call the function directly inside the conditional block instead of the macro. - For places where the entire conditional block is the macro, remove the test and make the macro unconditional. - Use BPF_MTAP() in if_pfsync on FreeBSD instead of an expanded version of the old semantics. Reviewed by: csjp (older version)
Diffstat (limited to 'sys/dev/ppbus/if_plip.c')
-rw-r--r--sys/dev/ppbus/if_plip.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/ppbus/if_plip.c b/sys/dev/ppbus/if_plip.c
index 2af0fd1..df59f1b 100644
--- a/sys/dev/ppbus/if_plip.c
+++ b/sys/dev/ppbus/if_plip.c
@@ -455,7 +455,7 @@ static void
lptap(struct ifnet *ifp, struct mbuf *m)
{
u_int32_t af = AF_INET;
- BPF_MTAP2(ifp, &af, sizeof(af), m);
+ bpf_mtap2(ifp, &af, sizeof(af), m);
}
static void
@@ -514,7 +514,7 @@ lp_intr (void *arg)
sc->sc_ifp->if_ibytes += len;
top = m_devget(sc->sc_ifbuf + CLPIPHDRLEN, len, 0, sc->sc_ifp, 0);
if (top) {
- if (sc->sc_ifp->if_bpf)
+ if (bpf_peers_present(sc->sc_ifp->if_bpf))
lptap(sc->sc_ifp, top);
netisr_queue(NETISR_IP, top); /* mbuf is free'd on failure. */
}
@@ -559,7 +559,7 @@ lp_intr (void *arg)
sc->sc_ifp->if_ibytes += len;
top = m_devget(sc->sc_ifbuf + LPIPHDRLEN, len, 0, sc->sc_ifp, 0);
if (top) {
- if (sc->sc_ifp->if_bpf)
+ if (bpf_peers_present(sc->sc_ifp->if_bpf))
lptap(sc->sc_ifp, top);
netisr_queue(NETISR_IP, top); /* mbuf is free'd on failure. */
}
@@ -694,7 +694,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
} else {
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
- if (ifp->if_bpf)
+ if (bpf_peers_present(ifp->if_bpf))
lptap(ifp, m);
}
@@ -739,7 +739,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
} else {
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
- if (ifp->if_bpf)
+ if (bpf_peers_present(ifp->if_bpf))
lptap(ifp, m);
}
OpenPOWER on IntegriCloud