Date: 7 Dec 2000 19:46:27 -0000 From: fujiwara@rcac.tdi.co.jp To: FreeBSD-gnats-submit@freebsd.org Cc: ohm@rcac.tdi.co.jp, fujiwara@rcac.tdi.co.jp Subject: misc/23362: tcpdump cannot work on CISCO_HDLC encoded link Message-ID: <20001207194627.1724.qmail@f.rcac.tdi.co.jp> Resent-Message-ID: <200012071950.eB7Jo1879793@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 23362
>Category: misc
>Synopsis: tcpdump wrong on sppp CISCO_HDLC encoded link
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Dec 07 11:50:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Kazunori_Fujiwara
>Release: FreeBSD 5.0-CURRENT i386, 4.*, 3.*
>Organization:
TDI Co, LTD.
>Environment:
System: FreeBSD spacecraft.f.rcac.tdi.co.jp 5.0-CURRENT FreeBSD 5.0-CURRENT #2: Mon Dec 4 04:46:08 JST 2000 fujiwara@spacecraft.f.rcac.tdi.co.jp:/usr/src/sys/compile/SPACECRAFT i386
FreeBSD 3/4/5, with/without kame
>Description:
FreeBSD's bpf doesnot distingish PPP and CISCO_HDLC.
tcpdump on CISCO_HDLC link with some expressions,
tcpdump don't catch any bpf data.
>How-To-Repeat:
use RISCom sr driver with CISCO_HDLC mode.
>Fix:
Support DLT_CHDLC with BPF and sr driver,
or catch CISCO_HDLC packet when DLT_PPP.
Index: /usr/src/contrib/libpcap/gencode.c
===================================================================
RCS file: /FreeBSD-CVS/src/contrib/libpcap/gencode.c,v
retrieving revision 1.8
diff -u -r1.8 gencode.c
--- /usr/src/contrib/libpcap/gencode.c 2000/03/04 23:57:39 1.8
+++ /usr/src/contrib/libpcap/gencode.c 2000/12/07 19:25:00
@@ -661,11 +661,19 @@
return gen_false();
case DLT_PPP:
- if (proto == ETHERTYPE_IP)
- proto = PPP_IP; /* XXX was 0x21 */
+ if (proto == ETHERTYPE_IP) {
+ b0 = gen_cmp(off_linktype, BPF_H, PPP_IP);
+ b1 = gen_cmp(off_linktype, BPF_H, proto);
+ gen_or(b0, b1);
+ return b1;
+ }
#ifdef INET6
- else if (proto == ETHERTYPE_IPV6)
- proto = PPP_IPV6;
+ if (proto == ETHERTYPE_IPV6) {
+ b0 = gen_cmp(off_linktype, BPF_H, PPP_IPV6);
+ b1 = gen_cmp(off_linktype, BPF_H, proto);
+ gen_or(b0, b1);
+ return b1;
+ }
#endif
break;
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001207194627.1724.qmail>
