diff options
author | John Baldwin <jhb@FreeBSD.org> | 2006-12-29 13:59:50 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2006-12-29 13:59:50 +0000 |
commit | 0dea849ae93133a4a02f0d5fd58340d3df92668b (patch) | |
tree | 5677cbe8565b075c609dc8ea0a6087d8251a7bca /sys/i4b/driver | |
parent | 240589a9fec34f1cd809cc429f2c56147a0383bd (diff) | |
download | src-0dea849ae93133a4a02f0d5fd58340d3df92668b.tar.gz src-0dea849ae93133a4a02f0d5fd58340d3df92668b.zip |
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)
Notes
Notes:
svn path=/head/; revision=165632
Diffstat (limited to 'sys/i4b/driver')
-rw-r--r-- | sys/i4b/driver/i4b_ipr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/i4b/driver/i4b_ipr.c b/sys/i4b/driver/i4b_ipr.c index 537ef3d263bb..c90e484b11e1 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 |