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/dev/my/if_my.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/my') diff --git a/sys/dev/my/if_my.c b/sys/dev/my/if_my.c index b8f00d2..0e9d106 100644 --- a/sys/dev/my/if_my.c +++ b/sys/dev/my/if_my.c @@ -1161,8 +1161,8 @@ my_rxeof(struct my_softc * sc) * broadcast packet, multicast packet, matches our ethernet * address or the interface is in promiscuous mode. */ - if (ifp->if_bpf) { - BPF_MTAP(ifp, m); + if (bpf_peers_present(ifp->if_bpf)) { + bpf_mtap(ifp, m); if (ifp->if_flags & IFF_PROMISC && (bcmp(eh->ether_dhost, IF_LLADDR(sc->my_ifp), ETHER_ADDR_LEN) && -- cgit v1.1