From: hannes Date: Fri, 8 Apr 2005 06:15:03 +0000 (+0000) Subject: fix compiler padding issue: struct cisco_slarp should be 18 bytes instead of 20 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/48811c1c527d1a8253255e1ab5eed45adf6c7885 fix compiler padding issue: struct cisco_slarp should be 18 bytes instead of 20 --- diff --git a/print-chdlc.c b/print-chdlc.c index a96a0318..6cb951f3 100644 --- a/print-chdlc.c +++ b/print-chdlc.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.28.2.3 2004-03-24 00:46:03 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.28.2.4 2005-04-08 06:15:03 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -113,22 +113,22 @@ chdlc_if_print(const struct pcap_pkthdr *h, register const u_char *p) } struct cisco_slarp { - u_int32_t code; + u_int8_t code[4]; #define SLARP_REQUEST 0 #define SLARP_REPLY 1 #define SLARP_KEEPALIVE 2 union { struct { - struct in_addr addr; - struct in_addr mask; - u_int16_t unused[3]; + u_int8_t addr[4]; + u_int8_t mask[4]; + u_int8_t unused[6]; } addr; struct { - u_int32_t myseq; - u_int32_t yourseq; - u_int16_t rel; - u_int16_t t1; - u_int16_t t2; + u_int8_t myseq[4]; + u_int8_t yourseq[4]; + u_int8_t rel[2]; + u_int8_t t1[2]; + u_int8_t t2[2]; } keep; } un; }; @@ -140,12 +140,12 @@ chdlc_slarp_print(const u_char *cp, u_int length) { const struct cisco_slarp *slarp; + printf("SLARP (length: %u), ",length); if (length < SLARP_LEN) goto trunc; slarp = (const struct cisco_slarp *)cp; TCHECK(*slarp); - printf("SLARP (length: %u), ",length); switch (EXTRACT_32BITS(&slarp->code)) { case SLARP_REQUEST: printf("request");