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
[-- Attachment #1 --]
On Fri, Jan 11, 2002 at 07:53:08AM -0800, CJTT wrote:
>
> (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 ;-(
>
> Is there anything I can do in stable that will allow
> me to see the packets (incoming)? If not, what magic
> will I have to perform in current that will do this?
>
> (Of course, if Luigi would add some simple link layer
> counting or diverting capability to ipfw, that would
> be ideal ;-)
>
> Thanks in advance....
This patch or something like it should work.
-- Brooks
Index: if_vlan.c
===================================================================
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;
+ /*
+ * 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
--
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
[-- Attachment #2 --]
-----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-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020111114726.B18998>
