]> The Tcpdump Group git mirrors - tcpdump/commitdiff
RT6: Fix alignment issue with Solaris Studio 12.3 on Solaris 10 SPARC
authorFrancois-Xavier Le Bail <[email protected]>
Sat, 11 Mar 2017 14:42:26 +0000 (15:42 +0100)
committerDenis Ovsienko <[email protected]>
Wed, 13 Sep 2017 11:25:44 +0000 (12:25 +0100)
Fix the 'Bus Error - core dumped' issue with the 'ipv6-routing-header' test
when '-m64' compiling option is used.

Fix with the method described in commit 1376682.

/opt/solarisstudio12.3/bin/cc -V
gives:
cc: Sun C 5.12 SunOS_sparc Patch 148917-09 2016/08/02

ip6.h
print-rt6.c

diff --git a/ip6.h b/ip6.h
index 986203414f8b78db5488395ed6fce93bbe8ed0c3..9a24ef143c8e8cacb273c02c06cb052d4b8b44d3 100644 (file)
--- a/ip6.h
+++ b/ip6.h
@@ -178,13 +178,13 @@ struct ip6_rthdr {
 /* Type 0 Routing header */
 /* Also used for Type 2 */
 struct ip6_rthdr0 {
-       uint8_t  ip6r0_nxt;             /* next header */
-       uint8_t  ip6r0_len;             /* length in units of 8 octets */
-       uint8_t  ip6r0_type;            /* always zero */
-       uint8_t  ip6r0_segleft;         /* segments left */
-       uint32_t ip6r0_reserved;        /* reserved field */
+       nd_uint8_t  ip6r0_nxt;          /* next header */
+       nd_uint8_t  ip6r0_len;          /* length in units of 8 octets */
+       nd_uint8_t  ip6r0_type;         /* always zero */
+       nd_uint8_t  ip6r0_segleft;      /* segments left */
+       nd_uint32_t ip6r0_reserved;     /* reserved field */
        struct in6_addr ip6r0_addr[1];  /* up to 23 addresses */
-} UNALIGNED;
+};
 
 /* Fragment header */
 struct ip6_frag {
index 0395791d763864ea34f0b91c9dbc2e3ebdcedb5b..3454adf70f54704f72a909ca8f78e4b2490c0d39 100644 (file)
 
 #include <string.h>
 
-#include "ip6.h"
-
 #include "netdissect.h"
 #include "addrtoname.h"
 #include "extract.h"
 
+#include "ip6.h"
+
 int
 rt6_print(netdissect_options *ndo, register const u_char *bp, const u_char *bp2 _U_)
 {