summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1996-08-19 21:37:18 +0000
committerpst <pst@FreeBSD.org>1996-08-19 21:37:18 +0000
commita8df284d77886c79ba3bde2acb1c1f6c3cb399cb (patch)
tree2ba8b0a0e0a4ef783e06fec07f7a4b2297672e1e /contrib
parent621d4a684596dd4c379cbc4def98bd6703c78f2e (diff)
downloadFreeBSD-src-a8df284d77886c79ba3bde2acb1c1f6c3cb399cb.zip
FreeBSD-src-a8df284d77886c79ba3bde2acb1c1f6c3cb399cb.tar.gz
Fix bugs in AARP packet handling and fake up a phantom LAP header
since Ethertalk doesn't actually put one out on the wire. Submitted by: Toshihiro Kanda <candy@fct.kgc.co.jp>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/tcpdump/print-atalk.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/contrib/tcpdump/print-atalk.c b/contrib/tcpdump/print-atalk.c
index e2ae825..7b1696c 100644
--- a/contrib/tcpdump/print-atalk.c
+++ b/contrib/tcpdump/print-atalk.c
@@ -101,9 +101,16 @@ atalk_print(register const u_char *bp, u_int length)
register const struct atShortDDP *sdp;
u_short snet;
+#if 0
lp = (struct LAP *)bp;
bp += sizeof(*lp);
length -= sizeof(*lp);
+#else
+ {
+ static struct LAP lp_ = {0, 0, lapDDP};
+ lp = &lp_;
+ }
+#endif
switch (lp->type) {
case lapShortDDP:
@@ -161,9 +168,9 @@ aarp_print(register const u_char *bp, u_int length)
printf("aarp ");
ap = (const struct aarp *)bp;
- if (ap->htype == 1 && ap->ptype == ETHERTYPE_ATALK &&
+ if (ntohs(ap->htype) == 1 && ntohs(ap->ptype) == ETHERTYPE_ATALK &&
ap->halen == 6 && ap->palen == 4 )
- switch (ap->op) {
+ switch (ntohs(ap->op)) {
case 1: /* request */
(void)printf("who-has %s tell %s",
@@ -172,7 +179,7 @@ aarp_print(register const u_char *bp, u_int length)
case 2: /* response */
(void)printf("reply %s is-at %s",
- AT(pdaddr), etheraddr_string(ap->hdaddr));
+ AT(psaddr), etheraddr_string(ap->hsaddr));
return;
case 3: /* probe (oy!) */
OpenPOWER on IntegriCloud