summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason <jason@openbsd.org>1999-06-30 00:00:29 +0000
committerjason <jason@openbsd.org>1999-06-30 00:00:29 +0000
commit3e89b5bb333f3e94e1a596338c5b10fe0691d280 (patch)
treeb56a9ff2a87a8ea163f195791e958c19108a657c
parentmention kern.arandom (diff)
downloadwireguard-openbsd-3e89b5bb333f3e94e1a596338c5b10fe0691d280.tar.xz
wireguard-openbsd-3e89b5bb333f3e94e1a596338c5b10fe0691d280.zip
bpfattach bridge's and provide tap for queued packets
-rw-r--r--sys/net/if_bridge.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index e4d9002964a..97e2d9f579e 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.10 1999/06/03 21:52:02 espie Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.11 1999/06/30 00:00:29 jason Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
@@ -32,6 +32,8 @@
*/
#include "bridge.h"
+#include "bpfilter.h"
+
#if NBRIDGE > 0
#include <sys/param.h>
@@ -63,6 +65,10 @@
#endif
#endif
+#if NBPFILTER > 0
+#include <net/bpf.h>
+#endif
+
#include <net/if_bridge.h>
#ifndef BRIDGE_RTABLE_SIZE
@@ -186,6 +192,10 @@ bridgeattach(unused)
ifp->if_snd.ifq_maxlen = ifqmaxlen;
ifp->if_hdrlen = sizeof(struct ether_header);
if_attach(ifp);
+#if NBPFILTER > 0
+ bpfattach(&bridgectl[i].sc_if.if_bpf, ifp,
+ DLT_EN10MB, sizeof(struct ether_header));
+#endif
}
}
@@ -697,6 +707,11 @@ bridgeintr(void)
continue;
}
+#if NBPFILTER > 0
+ if (sc->sc_if.if_bpf)
+ bpf_mtap(sc->sc_if.if_bpf, m);
+#endif
+
sc->sc_if.if_lastchange = time;
sc->sc_if.if_ipackets++;
sc->sc_if.if_ibytes += m->m_pkthdr.len;