From owner-freebsd-net Fri Jan 11 11:47:46 2002 Delivered-To: freebsd-net@freebsd.org Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by hub.freebsd.org (Postfix) with ESMTP id 30C9537B405 for ; Fri, 11 Jan 2002 11:47:27 -0800 (PST) Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.11.0/8.11.0) id g0BJlQg26099; Fri, 11 Jan 2002 11:47:26 -0800 Date: Fri, 11 Jan 2002 11:47:26 -0800 From: Brooks Davis To: CJTT Cc: freebsd-net@FreeBSD.ORG Subject: Re: ti driver, vlan and tcpdump Message-ID: <20020111114726.B18998@Odin.AC.HMC.Edu> References: <20011116090635.A31992@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="/NkBOFFp2J2Af1nK" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from cjtt@employees.org on Fri, Jan 11, 2002 at 07:53:08AM -0800 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --/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