When using hardware decoding, reconstruct the wire form of the ethernet

header and push it up any attached bpf devices on the parent interface.
This makes hardware vlan decoding more like the normal software path.

Tested by:	cjtt@employees.org
MFC after:	2 weeks
This commit is contained in:
Brooks Davis 2002-02-26 02:19:33 +00:00
parent 546f251b29
commit 7a46ec8f63
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=91272

View File

@ -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