]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/net/if_disc.c
xnu-1228.15.4.tar.gz
[apple/xnu.git] / bsd / net / if_disc.c
index f5f0fae650013b3f9e76907feaa23e73ea9a0f9f..00531fdff7a960c51a9d922d0a2b15c4d36d8abb 100644 (file)
@@ -153,21 +153,10 @@ discoutput(ifp, m, dst, rt)
        }
 
        if (discif.if_bpf) {
-               /*
-                * We need to prepend the address family as
-                * a four byte field.  Cons up a dummy header
-                * to pacify bpf.  This is safe because bpf
-                * will only read from the mbuf (i.e., it won't
-                * try to free it or keep a pointer a to it).
-                */
-               struct mbuf m0;
+               /* We need to prepend the address family as a four byte field. */
                u_int af = dst->sa_family;
 
-               m0.m_next = m;
-               m0.m_len = 4;
-               m0.m_data = (char *)⁡
-
-               bpf_mtap(&discif, &m0);
+               bpf_tap_out(ifp, 0, m, &af, sizeof(af));
        }
        m->m_pkthdr.rcvif = ifp;