From candy@fct.kgc.co.jp  Sun Jul  9 20:15:25 1995
Received: from mail0.iij.ad.jp (root@mail0.iij.ad.jp [192.244.176.61])
          by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id UAA23848
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 9 Jul 1995 20:15:23 -0700
Received: from uucp0.iij.ad.jp (uucp0.iij.ad.jp [192.244.176.51]) by mail0.iij.ad.jp (8.6.12+2.4W/3.3W9-MAIL) with ESMTP id MAA22893 for <FreeBSD-gnats-submit@freebsd.org>; Mon, 10 Jul 1995 12:15:20 +0900
Received: (from uucp@localhost) by uucp0.iij.ad.jp (8.6.12+2.4W/3.3W9-UUCP) with UUCP id MAA18702 for FreeBSD-gnats-submit@freebsd.org; Mon, 10 Jul 1995 12:15:21 +0900
Received: from xxx.fct.kgc.co.jp by fender.fct.kgc.co.jp (8.6.12+2.4W/3.3W8:95063017) id LAA26298; Mon, 10 Jul 1995 11:35:59 +0900
Received: by xxx.fct.kgc.co.jp (8.6.12+2.4W/3.3W8:95062916) id LAA24318; Mon, 10 Jul 1995 11:35:58 +0900
Message-Id: <199507100235.LAA24318@xxx.fct.kgc.co.jp>
Date: Mon, 10 Jul 1995 11:35:58 +0900
From: Toshihiro Kanda <candy@fct.kgc.co.jp>
Reply-To: candy@fct.kgc.co.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: tcpdump(1) doesn't show appletalk packets correctly
X-Send-Pr-Version: 3.2

>Number:         606
>Category:       bin
>Synopsis:       tcpdump(1) doesn't show appletalk packets correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs (FreeBSD bugs mailing list)
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul  9 20:20:02 1995
>Closed-Date:    Mon Jul 10 07:02:53 PDT 1995
>Last-Modified:
>Originator:     candy@fct.kgc.co.jp
>Release:        FreeBSD 2.0-RELEASE i386
>Organization:
Keisokugiken corp.
>Environment:

  A kernel configured with bpf

>Description:

  tcpdump(1) doesn't show appletalk packets correctly.

>How-To-Repeat:

  $ tcpdump 'ether[14:2]==0xaaa'

>Fix:

  Here's patch.  This also fixes printf() for unknown type.

  $ cd /usr/src/usr.sbin
  $ patch -p < this-patch

*** /usr/src/usr.sbin/tcpdump/tcpdump/print-ether.c	Wed Oct  5 07:31:44 1994
--- tcpdump/tcpdump/print-ether.c	Mon Jul 10 11:02:56 1995
***************
*** 122,128 ****
  		   && lp->llc_snap_oui[1] == 0x00
  		   && lp->llc_snap_oui[2] == 0x07) {
  			printf("[ethertalk] ");
! 			ddp_print((struct atDDP *)((char *)lp + 6),
  				  length - 6);
  		} else {
  			if(!eflag) {
--- 122,128 ----
  		   && lp->llc_snap_oui[1] == 0x00
  		   && lp->llc_snap_oui[2] == 0x07) {
  			printf("[ethertalk] ");
! 			ddp_print((struct atDDP *)((char *)lp + 8),
  				  length - 6);
  		} else {
  			if(!eflag) {
*** /usr/src/usr.sbin/tcpdump/tcpdump/print-atalk.c	Sat Jun 12 23:42:09 1993
--- tcpdump/tcpdump/print-atalk.c	Mon Jul 10 11:18:53 1995
***************
*** 67,73 ****
  		(void)printf(" truncated-ddp %d", length);
  		return;
  	}
! 	(void)printf("%s.%d > %s.%d:",
  		     ataddr_string(EXTRACT_SHORT(&dp->srcNet), dp->srcNode),
  		     dp->srcSkt,
  		     ataddr_string(EXTRACT_SHORT(&dp->dstNet), dp->dstNode),
--- 67,73 ----
  		(void)printf(" truncated-ddp %d", length);
  		return;
  	}
! 	(void)printf("%s.%x > %s.%x:",
  		     ataddr_string(EXTRACT_SHORT(&dp->srcNet), dp->srcNode),
  		     dp->srcSkt,
  		     ataddr_string(EXTRACT_SHORT(&dp->dstNet), dp->dstNode),
***************
*** 110,117 ****
  	case ddpKLAP:
  		(void)printf(" at-KLAP %d", length);
  		break;
  	default:
! 		(void)printf(" at-#%d %d", length);
  		break;
  	}
  }
--- 110,123 ----
  	case ddpKLAP:
  		(void)printf(" at-KLAP %d", length);
  		break;
+ 	case ddpZIP:
+ 		(void)printf(" at-ZIP %d", length);
+ 		break;
+ 	case ddpADSP:
+ 		(void)printf(" at-ADSP %d", length);
+ 		break;
  	default:
! 		(void)printf(" at-#%d %d", dp->type, length);
  		break;
  	}
  }
***************
*** 467,476 ****
  	tp->addr = (atnet << 8) | athost;
  	tp->nxt = (struct hnamemem *)calloc(1, sizeof(*tp));
  	if (athost != 255)
! 		(void)sprintf(nambuf, "%d.%d.%d",
  		    atnet >> 8, atnet & 0xff, athost);
  	else
! 		(void)sprintf(nambuf, "%d.%d", atnet >> 8, atnet & 0xff);
  	i = strlen(nambuf) + 1;
  	tp->name = strcpy(malloc((unsigned) i), nambuf);
  
--- 473,482 ----
  	tp->addr = (atnet << 8) | athost;
  	tp->nxt = (struct hnamemem *)calloc(1, sizeof(*tp));
  	if (athost != 255)
! 		(void)sprintf(nambuf, "%x.%x.%x",
  		    atnet >> 8, atnet & 0xff, athost);
  	else
! 		(void)sprintf(nambuf, "%x.%x", atnet >> 8, atnet & 0xff);
  	i = strlen(nambuf) + 1;
  	tp->name = strcpy(malloc((unsigned) i), nambuf);
  
*** /usr/src/usr.sbin/tcpdump/tcpdump/appletalk.h	Sat Jun 12 23:42:14 1993
--- tcpdump/tcpdump/appletalk.h	Mon Jul 10 11:13:34 1995
***************
*** 56,61 ****
--- 56,63 ----
  #define	ddpNBP		2	/* NBP type */
  #define	ddpATP		3	/* ATP type */
  #define	ddpECHO		4	/* ECHO type */
+ #define	ddpZIP		6	/* ZIP type */
+ #define	ddpADSP		7	/* ADSP type */
  #define	ddpIP		22	/* IP type */
  #define	ddpARP		23	/* ARP type */
  #define	ddpKLAP		0x4b	/* Kinetics KLAP type */
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: wollman 
State-Changed-When: Mon Jul 10 07:02:53 PDT 1995 
State-Changed-Why:  
This report pertains to the version of tcpdump in 2.0-Release.  A new 
version of tcpdump was imported soon after that release which handles 
appletalk differently. 
>Unformatted:



