X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/e89409254248af64db721ede4babbe9fd1753f6c..8fb0656b71083c70f6c749a5cb9ad7152abb2a9d:/print-arp.c diff --git a/print-arp.c b/print-arp.c index 1ef2505f..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.46 2000-09-23 08:03: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,11 +30,6 @@ static const char rcsid[] = #include #include -#include - -struct mbuf; -struct rtentry; -#include #include @@ -84,6 +79,8 @@ struct arphdr { #endif }; +#define ARP_HDRLEN 8 + /* * Ethernet Address Resolution Protocol. * @@ -104,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) @@ -131,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;