From owner-freebsd-hackers Mon Jan 22 12:42:35 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id MAA12333 for hackers-outgoing; Mon, 22 Jan 1996 12:42:35 -0800 (PST) Received: from alpha.xerox.com (alpha.Xerox.COM [13.1.64.93]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id MAA12327 for ; Mon, 22 Jan 1996 12:42:32 -0800 (PST) Received: from crevenia.parc.xerox.com ([13.2.116.11]) by alpha.xerox.com with SMTP id <53558(14)>; Mon, 22 Jan 1996 12:35:03 PST Received: from localhost ([127.0.0.1]) by crevenia.parc.xerox.com with SMTP id <177479>; Mon, 22 Jan 1996 12:34:28 -0800 X-Mailer: exmh version 1.6.4 10/10/95 To: Philippe Regnauld cc: hackers@freebsd.org (hackers) Subject: Re: tcpdump barfs on interface lp0 In-reply-to: Your message of "Sat, 20 Jan 1996 18:50:57 PST." <199601210250.DAA00319@tetard.frmug.fr.net> Mime-Version: 1.0 Content-Type: multipart/mixed ; boundary="===_0_Mon_Jan_22_12:33:42_PST_1996" Date: Mon, 22 Jan 1996 12:34:20 PST From: Bill Fenner Message-Id: <96Jan22.123428pst.177479@crevenia.parc.xerox.com> Sender: owner-hackers@freebsd.org Precedence: bulk This is a multipart MIME message. --===_0_Mon_Jan_22_12:33:42_PST_1996 Content-Type: text/plain; charset=us-ascii This is probably because the lpt driver incorrectly uses the DLT_NULL encapsulation; it prepends 2 bytes but tcpdump expects 4. Try this patch. Bill --===_0_Mon_Jan_22_12:33:42_PST_1996 Content-Type: application/octet-stream Content-Description: lpt.c.diff *** lpt.c.orig Mon Jan 22 12:26:45 1996 --- lpt.c Mon Jan 22 12:30:12 1996 *************** *** 1344,1360 **** if (ifp->if_bpf) { /* * We need to prepend the packet type as ! * a two byte field. Cons up a dummy header * to pacify bpf. This is safe because bpf * will only read from the mbuf (i.e., it won't * try to free it or keep a pointer to it). */ struct mbuf m0; ! u_short hdr = 0x800; m0.m_next = m; ! m0.m_len = 2; ! m0.m_data = (char *)&hdr; bpf_mtap(ifp->if_bpf, &m0); } --- 1344,1364 ---- if (ifp->if_bpf) { /* * We need to prepend the packet type as ! * a two byte field. The DLT_NULL encapsulation ! * assumes a four byte header. Cons up a dummy header * to pacify bpf. This is safe because bpf * will only read from the mbuf (i.e., it won't * try to free it or keep a pointer to it). */ struct mbuf m0; ! struct { ! u_short type; ! u_short padding; ! } nullhdr = { 0x800 }; m0.m_next = m; ! m0.m_len = 4; ! m0.m_data = (char *)&nullhdr; bpf_mtap(ifp->if_bpf, &m0); } --===_0_Mon_Jan_22_12:33:42_PST_1996--