summaryrefslogtreecommitdiff
path: root/sys/net/if_bridge.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>1999-06-30 00:00:30 +0000
committerJason Wright <jason@cvs.openbsd.org>1999-06-30 00:00:30 +0000
commit8a3e228971cdd549b5c7c1a0861713d21d0e4289 (patch)
tree259f96b4b910c080356da82d5812c23620e421ef /sys/net/if_bridge.c
parenta32269f399a5765221f62bf9fff64c281bd01e37 (diff)
bpfattach bridge's and provide tap for queued packets
Diffstat (limited to 'sys/net/if_bridge.c')
-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;