Index: bpf.c =================================================================== RCS file: /cvs/src/sys/net/bpf.c,v diff -u -p -r1.231 bpf.c --- bpf.c 5 Feb 2025 18:29:17 -0000 1.231 +++ bpf.c 3 Mar 2025 12:13:17 -0000 @@ -1749,13 +1749,22 @@ bpfsattach(caddr_t *bpfp, const char *na return (bp); } -void -bpfattach(caddr_t *driverp, struct ifnet *ifp, u_int dlt, u_int hdrlen) +void * +bpfxattach(caddr_t *driverp, const char *name, struct ifnet *ifp, + u_int dlt, u_int hdrlen) { struct bpf_if *bp; - bp = bpfsattach(driverp, ifp->if_xname, dlt, hdrlen); + bp = bpfsattach(driverp, name, dlt, hdrlen); bp->bif_ifp = ifp; + + return (bp); +} + +void +bpfattach(caddr_t *driverp, struct ifnet *ifp, u_int dlt, u_int hdrlen) +{ + bpfxattach(driverp, ifp->if_xname, ifp, dlt, hdrlen); } /* Detach an interface from its attached bpf device. */ Index: bpf.h =================================================================== RCS file: /cvs/src/sys/net/bpf.h,v diff -u -p -r1.73 bpf.h --- bpf.h 15 Aug 2024 12:20:20 -0000 1.73 +++ bpf.h 3 Mar 2025 12:13:17 -0000 @@ -327,6 +327,7 @@ int bpf_tap_hdr(caddr_t, const void *, void bpfattach(caddr_t *, struct ifnet *, u_int, u_int); void bpfdetach(struct ifnet *); void *bpfsattach(caddr_t *, const char *, u_int, u_int); +void *bpfxattach(caddr_t *, const char *, struct ifnet *, u_int, u_int); void bpfsdetach(void *); void bpfilterattach(int);