summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2002-02-26 02:19:33 +0000
committerBrooks Davis <brooks@FreeBSD.org>2002-02-26 02:19:33 +0000
commit7a46ec8f637d56021a2bc25a6b8720f5a52948a3 (patch)
tree221b52bd402617ce92a14cadf0084df56951ad8d
parent546f251b29cc7802b6e267894f96a475f5bf2e5f (diff)
Notes
-rw-r--r--sys/net/if_vlan.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 851275227e77..759ae81be5c8 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -401,6 +401,26 @@ vlan_input_tag(struct ether_header *eh, struct mbuf *m, u_int16_t t)
{
struct ifvlan *ifv;
+ /*
+ * Fake up a header and send the packet to the physical interface's
+ * bpf tap if active.
+ */
+ if (m->m_pkthdr.rcvif->if_bpf != NULL) {
+ struct m_hdr mh;
+ struct ether_vlan_header evh;
+
+ bcopy(eh, &evh, 2*ETHER_ADDR_LEN);
+ evh.evl_encap_proto = htons(ETHERTYPE_VLAN);
+ evh.evl_tag = htons(t);
+ evh.evl_proto = eh->ether_type;
+
+ /* This kludge is OK; BPF treats the "mbuf" as read-only */
+ mh.mh_next = m;
+ mh.mh_data = (char *)&evh;
+ mh.mh_len = ETHER_HDR_LEN + EVL_ENCAPLEN;
+ bpf_mtap(m->m_pkthdr.rcvif, (struct mbuf *)&mh);
+ }
+
for (ifv = LIST_FIRST(&ifv_list); ifv != NULL;
ifv = LIST_NEXT(ifv, ifv_list)) {
if (m->m_pkthdr.rcvif == ifv->ifv_p