diff options
Diffstat (limited to 'sys/net/if_loop.c')
-rw-r--r-- | sys/net/if_loop.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index e160790..de692e5 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -82,11 +82,6 @@ #include <netatalk/at_var.h> #endif NETATALK -#include "bpf.h" -#if NBPF > 0 -#include <net/bpfdesc.h> -#endif - static int loioctl __P((struct ifnet *, u_long, caddr_t)); static void lortrequest __P((int, struct rtentry *, struct sockaddr *)); @@ -122,9 +117,7 @@ loopattach(dummy) ifp->if_type = IFT_LOOP; ifp->if_snd.ifq_maxlen = ifqmaxlen; if_attach(ifp); -#if NBPF > 0 bpfattach(ifp, DLT_NULL, sizeof(u_int)); -#endif } } @@ -186,7 +179,6 @@ if_simloop(ifp, m, dst, hlen) if ((m->m_flags & M_PKTHDR) == 0) panic("if_simloop: no HDR"); m->m_pkthdr.rcvif = ifp; -#if NBPF > 0 /* BPF write needs to be handled specially */ if (dst->sa_family == AF_UNSPEC) { dst->sa_family = *(mtod(m, int *)); @@ -199,22 +191,19 @@ if_simloop(ifp, m, dst, hlen) struct mbuf m0, *n = m; u_int af = dst->sa_family; - if (ifp->if_bpf->bif_dlt == DLT_NULL) { - /* - * 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). - */ - m0.m_next = m; - m0.m_len = 4; - m0.m_data = (char *)⁡ - n = &m0; - } + /* + * 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). + */ + m0.m_next = m; + m0.m_len = 4; + m0.m_data = (char *)⁡ + n = &m0; bpf_mtap(ifp, n); } -#endif /* Strip away media header */ if (hlen > 0) { |