Date: Sun, 9 Jul 1995 20:20:03 -0700 From: Toshihiro Kanda <candy@fct.kgc.co.jp> To: freebsd-bugs Subject: bin/606: tcpdump(1) doesn't show appletalk packets correctly Message-ID: <199507100320.UAA23960@freefall.cdrom.com> In-Reply-To: Your message of Mon, 10 Jul 1995 11:35:58 %2B0900 <199507100235.LAA24318@xxx.fct.kgc.co.jp>
index | next in thread | previous in thread | raw e-mail
>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: open
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Jul 9 20:20:02 1995
>Originator: candy@fct.kgc.co.jp
>Organization:
Keisokugiken corp.
>Release: FreeBSD 2.0-RELEASE i386
>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 */
>Audit-Trail:
>Unformatted:
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507100320.UAA23960>
