diff options
author | Paul Traina <pst@FreeBSD.org> | 1996-08-19 21:37:18 +0000 |
---|---|---|
committer | Paul Traina <pst@FreeBSD.org> | 1996-08-19 21:37:18 +0000 |
commit | 1249582f6e2f8e82e244461256746edf9bfdc324 (patch) | |
tree | 2ba8b0a0e0a4ef783e06fec07f7a4b2297672e1e /contrib/tcpdump | |
parent | 930ecf536c19ee5d9eeb71e8ab7baf176fc751c3 (diff) | |
download | src-1249582f6e2f8e82e244461256746edf9bfdc324.tar.gz src-1249582f6e2f8e82e244461256746edf9bfdc324.zip |
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>
Notes
Notes:
svn path=/head/; revision=17690
Diffstat (limited to 'contrib/tcpdump')
-rw-r--r-- | contrib/tcpdump/print-atalk.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/contrib/tcpdump/print-atalk.c b/contrib/tcpdump/print-atalk.c index e2ae8252889d..7b1696cc9434 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!) */ |