Date: Fri, 11 Jan 2002 11:47:26 -0800 From: Brooks Davis <brooks@one-eyed-alien.net> To: CJTT <cjtt@employees.org> Cc: freebsd-net@FreeBSD.ORG Subject: Re: ti driver, vlan and tcpdump Message-ID: <20020111114726.B18998@Odin.AC.HMC.Edu> In-Reply-To: <Pine.GSO.3.96.1020111074219.22308A-100000@willers.employees.org>; from cjtt@employees.org on Fri, Jan 11, 2002 at 07:53:08AM -0800 References: <20011116090635.A31992@Odin.AC.HMC.Edu> <Pine.GSO.3.96.1020111074219.22308A-100000@willers.employees.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--/NkBOFFp2J2Af1nK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 11, 2002 at 07:53:08AM -0800, CJTT wrote: >=20 > (using the ti and and also the bge drivers).... > with 4.5-PRERELEASE (cvs'upped two days ago), I've now lost > the ability to see the VLAN traffic on the main interface > (even with no VLAN in the kernel!)...so once again, > I've lost that loving feeling ;-( >=20 > Is there anything I can do in stable that will allow > me to see the packets (incoming)? If not, what magic=20 > will I have to perform in current that will do this? >=20 > (Of course, if Luigi would add some simple link layer > counting or diverting capability to ipfw, that would > be ideal ;-) >=20 > Thanks in advance.... This patch or something like it should work. -- Brooks Index: if_vlan.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/cvs/src/sys/net/if_vlan.c,v retrieving revision 1.36 diff -u -r1.36 if_vlan.c --- if_vlan.c 21 Nov 2001 20:29:08 -0000 1.36 +++ if_vlan.c 19 Dec 2001 01:42:10 -0000 @@ -401,6 +401,26 @@ { struct ifvlan *ifv; =20 + /* + * Fake up a header and send the packet to the physical interface's + * bpf tap if active. + */ + if (m->m_pkthdr.rcvif->if_bpf !=3D NULL) { + struct m_hdr mh; + struct ether_vlan_header evh; + + bcopy(eh, &evh, 2*ETHER_ADDR_LEN); + evh.evl_encap_proto =3D htons(ETHERTYPE_VLAN); + evh.evl_tag =3D htons(t); + evh.evl_proto =3D eh->ether_type; + + /* This kludge is OK; BPF treats the "mbuf" as read-only */ + mh.mh_next =3D m; + mh.mh_data =3D (char *)&evh; + mh.mh_len =3D ETHER_HDR_LEN + EVL_ENCAPLEN; + bpf_mtap(m->m_pkthdr.rcvif, (struct mbuf *)&mh); + } + for (ifv =3D LIST_FIRST(&ifv_list); ifv !=3D NULL; ifv =3D LIST_NEXT(ifv, ifv_list)) { if (m->m_pkthdr.rcvif =3D=3D ifv->ifv_p --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --/NkBOFFp2J2Af1nK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8P0FNXY6L6fI4GtQRAsofAKDiLIdBH/bO91PHD62W0Hfx9Z6VLQCfVFca tZKPeoaQZ80EJVDbnJ7OKzw= =97fd -----END PGP SIGNATURE----- --/NkBOFFp2J2Af1nK-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020111114726.B18998>