From 67155fb0b2a1b3d5ee6f59198ae389f826754c66 Mon Sep 17 00:00:00 2001 From: jhb Date: Fri, 29 Dec 2006 13:59:50 +0000 Subject: 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) --- sys/i4b/driver/i4b_ipr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/i4b') diff --git a/sys/i4b/driver/i4b_ipr.c b/sys/i4b/driver/i4b_ipr.c index 537ef3d..c90e484 100644 --- a/sys/i4b/driver/i4b_ipr.c +++ b/sys/i4b/driver/i4b_ipr.c @@ -883,7 +883,7 @@ error: } #endif - if(sc->sc_ifp->if_bpf) + if(bpf_peers_present(sc->sc_ifp->if_bpf)) { /* prepend the address family as a four byte field */ struct mbuf mm; @@ -891,7 +891,7 @@ error: mm.m_next = m; mm.m_len = 4; mm.m_data = (char *)⁡ - BPF_MTAP(sc->sc_ifp, &mm); + bpf_mtap(sc->sc_ifp, &mm); } if(netisr_queue(NETISR_IP, m)) /* (0) on success. */ @@ -936,7 +936,7 @@ ipr_tx_queue_empty(int unit) microtime(&sc->sc_ifp->if_lastchange); - if(sc->sc_ifp->if_bpf) + if(bpf_peers_present(sc->sc_ifp->if_bpf)) { /* prepend the address family as a four byte field */ @@ -945,7 +945,7 @@ ipr_tx_queue_empty(int unit) mm.m_next = m; mm.m_len = 4; mm.m_data = (char *)⁡ - BPF_MTAP(sc->sc_ifp, &mm); + bpf_mtap(sc->sc_ifp, &mm); } #if I4BIPRACCT -- cgit v1.1