X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/6f8f2af2fb52a8ec36a195792732f0924831559b..1e73a0fd9df4c3352bb72344afdae8ccd6146c09:/print-arp.c diff --git a/print-arp.c b/print-arp.c index 26cb7cde..3ba8a7e6 100644 --- a/print-arp.c +++ b/print-arp.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-arp.c,v 1.47 2000-09-24 07:42:31 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-arp.c,v 1.49 2000-10-10 05:05:07 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -30,7 +30,8 @@ static const char rcsid[] = #include #include -#include + +#include #include #include @@ -78,6 +79,8 @@ struct arphdr { #endif }; +#define ARP_HDRLEN 8 + /* * Ethernet Address Resolution Protocol. * @@ -98,6 +101,8 @@ struct ether_arp { #define arp_pln ea_hdr.ar_pln #define arp_op ea_hdr.ar_op +#define ETHER_ARP_HDRLEN (ARP_HDRLEN + 6 + 4 + 6 + 4) + #define SHA(ap) ((ap)->arp_sha) #define THA(ap) ((ap)->arp_tha) #define SPA(ap) ((ap)->arp_spa) @@ -125,7 +130,7 @@ arp_print(register const u_char *bp, u_int length, u_int caplen) printf("[|arp]"); return; } - if (length < sizeof(struct ether_arp)) { + if (length < ETHER_ARP_HDRLEN) { (void)printf("truncated-arp"); default_print((u_char *)ap, length); return;