summaryrefslogtreecommitdiffstats
path: root/sys/net/if_loop.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-09-25 12:06:01 +0000
committerphk <phk@FreeBSD.org>1999-09-25 12:06:01 +0000
commitd612df1de637eabac588385f0ef90f8d91a297de (patch)
tree98ecfb3ce51180cb27c6f26afbbda3e06f598865 /sys/net/if_loop.c
parent5f4944fbfdbe191d7f3f19a522957a406819ad3b (diff)
downloadFreeBSD-src-d612df1de637eabac588385f0ef90f8d91a297de.zip
FreeBSD-src-d612df1de637eabac588385f0ef90f8d91a297de.tar.gz
Remove NBPF conditionality of bpf calls in most of our network drivers.
This means that we will not have to have a bpf and a non-bpf version of our driver modules. This does not open any security hole, because the bpf core isn't loadable The drivers left unchanged are the "cross platform" drivers where the respective maintainers are urged to DTRT, whatever that may be. Add a couple of missing FreeBSD tags.
Diffstat (limited to 'sys/net/if_loop.c')
-rw-r--r--sys/net/if_loop.c33
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 *)&af;
- 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 *)&af;
+ n = &m0;
bpf_mtap(ifp, n);
}
-#endif
/* Strip away media header */
if (hlen > 0) {
OpenPOWER on IntegriCloud