this removes the cpfn argument from bpf_mtap_hdr since nothing uses it anymore.
the last thing to use it was pflog, and that's been reworked to avoid it a week or so ago. this is a largely mechanical diff to remove the cpfn argument, and adjust all the callers to cope. there's some followup work that can be done to clean up bpf internally, but that's for later. ok? Index: net/bpf.h =================================================================== RCS file: /cvs/src/sys/net/bpf.h,v retrieving revision 1.67 diff -u -p -r1.67 bpf.h --- net/bpf.h 12 Sep 2019 01:17:38 -0000 1.67 +++ net/bpf.h 19 Sep 2019 01:21:36 -0000 @@ -315,8 +315,7 @@ struct mbuf; int bpf_validate(struct bpf_insn *, int); int bpf_mtap(caddr_t, const struct mbuf *, u_int); -int bpf_mtap_hdr(caddr_t, const void *, u_int, const struct mbuf *, u_int, - void (*)(const void *, void *, size_t)); +int bpf_mtap_hdr(caddr_t, const void *, u_int, const struct mbuf *, u_int); int bpf_mtap_af(caddr_t, u_int32_t, const struct mbuf *, u_int); int bpf_mtap_ether(caddr_t, const struct mbuf *, u_int); int bpf_tap_hdr(caddr_t, const void *, u_int, const void *, u_int, u_int); Index: net/bpf.c =================================================================== RCS file: /cvs/src/sys/net/bpf.c,v retrieving revision 1.179 diff -u -p -r1.179 bpf.c --- net/bpf.c 12 Sep 2019 01:25:14 -0000 1.179 +++ net/bpf.c 19 Sep 2019 01:21:36 -0000 @@ -1368,7 +1368,7 @@ bpf_mtap(caddr_t arg, const struct mbuf */ int bpf_mtap_hdr(caddr_t arg, const void *data, u_int dlen, const struct mbuf *m, - u_int direction, void (*cpfn)(const void *, void *, size_t)) + u_int direction) { struct m_hdr mh; const struct mbuf *m0; @@ -1382,7 +1382,7 @@ bpf_mtap_hdr(caddr_t arg, const void *da } else m0 = m; - return _bpf_mtap(arg, m0, direction, cpfn); + return _bpf_mtap(arg, m0, direction, NULL); } /* @@ -1401,7 +1401,7 @@ bpf_mtap_af(caddr_t arg, u_int32_t af, c afh = htonl(af); - return bpf_mtap_hdr(arg, &afh, sizeof(afh), m, direction, NULL); + return bpf_mtap_hdr(arg, &afh, sizeof(afh), m, direction); } /* @@ -1446,7 +1446,7 @@ bpf_mtap_ether(caddr_t arg, const struct mh.mh_next = m->m_next; return bpf_mtap_hdr(arg, &evh, sizeof(evh), - (struct mbuf *)&mh, direction, NULL); + (struct mbuf *)&mh, direction); #endif } Index: dev/pci/if_iwi.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_iwi.c,v retrieving revision 1.142 diff -u -p -r1.142 if_iwi.c --- dev/pci/if_iwi.c 18 Sep 2019 23:52:32 -0000 1.142 +++ dev/pci/if_iwi.c 19 Sep 2019 01:21:36 -0000 @@ -937,7 +937,7 @@ iwi_frame_intr(struct iwi_softc *sc, str tap->wr_flags |= IEEE80211_RADIOTAP_F_SHORTPRE; bpf_mtap_hdr(sc->sc_drvbpf, tap, sc->sc_rxtap_len, - m, BPF_DIRECTION_IN, NULL); + m, BPF_DIRECTION_IN); } #endif @@ -1268,7 +1268,7 @@ iwi_tx_start(struct ifnet *ifp, struct m tap->wt_chan_flags = htole16(ic->ic_bss->ni_chan->ic_flags); bpf_mtap_hdr(sc->sc_drvbpf, tap, sc->sc_txtap_len, - m0, BPF_DIRECTION_OUT, NULL); + m0, BPF_DIRECTION_OUT); } #endif Index: dev/pci/if_iwm.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_iwm.c,v retrieving revision 1.251 diff -u -p -r1.251 if_iwm.c --- dev/pci/if_iwm.c 18 Sep 2019 23:52:32 -0000 1.251 +++ dev/pci/if_iwm.c 19 Sep 2019 01:21:36 -0000 @@ -3555,7 +3555,7 @@ iwm_rx_rx_mpdu(struct iwm_softc *sc, str } bpf_mtap_hdr(sc->sc_drvbpf, tap, sc->sc_rxtap_len, - m, BPF_DIRECTION_IN, NULL); + m, BPF_DIRECTION_IN); } #endif ieee80211_inputm(IC2IFP(ic), m, ni, &rxi, ml); @@ -4262,7 +4262,7 @@ iwm_tx(struct iwm_softc *sc, struct mbuf tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; bpf_mtap_hdr(sc->sc_drvbpf, tap, sc->sc_txtap_len, - m, BPF_DIRECTION_OUT, NULL); + m, BPF_DIRECTION_OUT); } #endif Index: dev/pci/if_iwn.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_iwn.c,v retrieving revision 1.217 diff -u -p -r1.217 if_iwn.c --- dev/pci/if_iwn.c 18 Sep 2019 23:52:32 -0000 1.217 +++ dev/pci/if_iwn.c 19 Sep 2019 01:21:36 -0000 @@ -2227,7 +2227,7 @@ iwn_rx_done(struct iwn_softc *sc, struct } bpf_mtap_hdr(sc->sc_drvbpf, tap, sc->sc_rxtap_len, - m, BPF_DIRECTION_IN, NULL); + m, BPF_DIRECTION_IN); } #endif @@ -3277,7 +3277,7 @@ iwn_tx(struct iwn_softc *sc, struct mbuf tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; bpf_mtap_hdr(sc->sc_drvbpf, tap, sc->sc_txtap_len, - m, BPF_DIRECTION_OUT, NULL); + m, BPF_DIRECTION_OUT); } #endif Index: dev/pci/if_mcx.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_mcx.c,v retrieving revision 1.33 diff -u -p -r1.33 if_mcx.c --- dev/pci/if_mcx.c 12 Sep 2019 04:23:59 -0000 1.33 +++ dev/pci/if_mcx.c 19 Sep 2019 01:21:36 -0000 @@ -6352,7 +6352,7 @@ mcx_start(struct ifqueue *ifq) if (ifp->if_bpf) bpf_mtap_hdr(ifp->if_bpf, (caddr_t)sqe->sqe_inline_headers, - MCX_SQ_INLINE_SIZE, m, BPF_DIRECTION_OUT, NULL); + MCX_SQ_INLINE_SIZE, m, BPF_DIRECTION_OUT); #endif map = ms->ms_map; bus_dmamap_sync(sc->sc_dmat, map, 0, map->dm_mapsize, Index: dev/pci/if_wpi.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_wpi.c,v retrieving revision 1.148 diff -u -p -r1.148 if_wpi.c --- dev/pci/if_wpi.c 18 Sep 2019 23:52:32 -0000 1.148 +++ dev/pci/if_wpi.c 19 Sep 2019 01:21:36 -0000 @@ -1331,7 +1331,7 @@ wpi_rx_done(struct wpi_softc *sc, struct } bpf_mtap_hdr(sc->sc_drvbpf, tap, sc->sc_rxtap_len, - m, BPF_DIRECTION_IN, NULL); + m, BPF_DIRECTION_IN); } #endif @@ -1711,7 +1711,7 @@ wpi_tx(struct wpi_softc *sc, struct mbuf tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; bpf_mtap_hdr(sc->sc_drvbpf, tap, sc->sc_txtap_len, - m, BPF_DIRECTION_OUT, NULL); + m, BPF_DIRECTION_OUT); } #endif Index: net/if_pflog.c =================================================================== RCS file: /cvs/src/sys/net/if_pflog.c,v retrieving revision 1.84 diff -u -p -r1.84 if_pflog.c --- net/if_pflog.c 13 Sep 2019 01:47:51 -0000 1.84 +++ net/if_pflog.c 19 Sep 2019 01:21:36 -0000 @@ -418,5 +418,5 @@ pflog_mtap(caddr_t if_bpf, struct pflogh m = pd.m; copy: bpf_mtap_hdr(if_bpf, pfloghdr, sizeof(*pfloghdr), m, - BPF_DIRECTION_OUT, NULL); + BPF_DIRECTION_OUT); } Index: net/if_switch.c =================================================================== RCS file: /cvs/src/sys/net/if_switch.c,v retrieving revision 1.28 diff -u -p -r1.28 if_switch.c --- net/if_switch.c 12 May 2019 16:24:44 -0000 1.28 +++ net/if_switch.c 19 Sep 2019 01:21:36 -0000 @@ -1494,7 +1494,7 @@ switch_mtap(caddr_t arg, struct mbuf *m, of.of_direction = htonl(dir == BPF_DIRECTION_IN ? DLT_OPENFLOW_TO_SWITCH : DLT_OPENFLOW_TO_CONTROLLER); - return (bpf_mtap_hdr(arg, (caddr_t)&of, sizeof(of), m, dir, NULL)); + return (bpf_mtap_hdr(arg, (caddr_t)&of, sizeof(of), m, dir)); } int Index: netinet/ip_ah.c =================================================================== RCS file: /cvs/src/sys/netinet/ip_ah.c,v retrieving revision 1.143 diff -u -p -r1.143 ip_ah.c --- netinet/ip_ah.c 28 Aug 2018 15:15:02 -0000 1.143 +++ netinet/ip_ah.c 19 Sep 2019 01:21:36 -0000 @@ -914,7 +914,7 @@ ah_output(struct mbuf *m, struct tdb *td hdr.flags |= M_AUTH; bpf_mtap_hdr(encif->if_bpf, (char *)&hdr, - ENC_HDRLEN, m, BPF_DIRECTION_OUT, NULL); + ENC_HDRLEN, m, BPF_DIRECTION_OUT); } } #endif Index: netinet/ip_esp.c =================================================================== RCS file: /cvs/src/sys/netinet/ip_esp.c,v retrieving revision 1.158 diff -u -p -r1.158 ip_esp.c --- netinet/ip_esp.c 28 Aug 2018 15:15:02 -0000 1.158 +++ netinet/ip_esp.c 19 Sep 2019 01:21:36 -0000 @@ -767,7 +767,7 @@ esp_output(struct mbuf *m, struct tdb *t hdr.flags |= M_AUTH; bpf_mtap_hdr(encif->if_bpf, (char *)&hdr, - ENC_HDRLEN, m, BPF_DIRECTION_OUT, NULL); + ENC_HDRLEN, m, BPF_DIRECTION_OUT); } } #endif Index: netinet/ip_ipcomp.c =================================================================== RCS file: /cvs/src/sys/netinet/ip_ipcomp.c,v retrieving revision 1.66 diff -u -p -r1.66 ip_ipcomp.c --- netinet/ip_ipcomp.c 13 Sep 2018 12:29:43 -0000 1.66 +++ netinet/ip_ipcomp.c 19 Sep 2019 01:21:36 -0000 @@ -337,7 +337,7 @@ ipcomp_output(struct mbuf *m, struct tdb hdr.spi = tdb->tdb_spi; bpf_mtap_hdr(encif->if_bpf, (char *)&hdr, - ENC_HDRLEN, m, BPF_DIRECTION_OUT, NULL); + ENC_HDRLEN, m, BPF_DIRECTION_OUT); } } #endif Index: netinet/ipsec_input.c =================================================================== RCS file: /cvs/src/sys/netinet/ipsec_input.c,v retrieving revision 1.168 diff -u -p -r1.168 ipsec_input.c --- netinet/ipsec_input.c 9 Nov 2018 13:26:12 -0000 1.168 +++ netinet/ipsec_input.c 19 Sep 2019 01:21:36 -0000 @@ -677,7 +677,7 @@ ipsec_common_input_cb(struct mbuf *m, st hdr.flags = m->m_flags & (M_AUTH|M_CONF); bpf_mtap_hdr(encif->if_bpf, (char *)&hdr, - ENC_HDRLEN, m, BPF_DIRECTION_IN, NULL); + ENC_HDRLEN, m, BPF_DIRECTION_IN); } } #endif