Subject: bin/18398: tcpdump crashes when receiving CDP-packets
To: None <>
From: None <opp@MuFFiN.Org>
List: netbsd-bugs
Date: 09/24/2002 16:10:40
>Number:         18398
>Category:       bin
>Synopsis:       tcpdump crashes when receiving CDP-packets
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 24 07:11:00 PDT 2002
>Originator:     Oliver Paulzen
>Release:        NetBSD 1.6
System: NetBSD chocolate 1.6 NetBSD 1.6 (CHOCOLATE) #0: Sun Sep 22 22:18:31 CEST 2002 root@chocolate:/usr/src/sys/arch/sparc64/compile/CHOCOLATE sparc64
Architecture: sparc64
Machine: sparc64
tcpdump core-dumps in print-cdp.c when a CDP packet is received:

Program received signal SIGBUS, Bus error.
cdp_print_addr (p=0x3b60b7 "", l=13)
    at /usr/src/usr.sbin/tcpdump/../../dist/tcpdump/print-cdp.c:174
174             num = EXTRACT_32BITS(p);

This is on both, sparc and sparc64 with NetBSD-1.6 and possibly others 
where unaligned 32-bit access isn't allowed

Start tcpdump and wait for the switch to send a CDP packet
Add -DLBL_ALIGN=1 to CPPFLAGS in /usr/src/usr.sbin/tcpdump/Makefile