]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Squelch some alignment warnings.
authorGuy Harris <[email protected]>
Sat, 22 Jul 2017 20:25:46 +0000 (13:25 -0700)
committerGuy Harris <[email protected]>
Sat, 22 Jul 2017 20:25:46 +0000 (13:25 -0700)
Make src and dst "const void *"s to squelch

    taking address of packed member 'ip6_dst' of class or structure
    'ip6_hdr' may result in an unaligned pointer value
    [-Waddress-of-packed-member]

warnings from some versions of Clang.

print-tcp.c

index e0d0531b36b26eed49ff08449cc6c880cb0524e0..c9b50feedb1570932c55003fec9052e340d660e3 100644 (file)
@@ -252,12 +252,12 @@ tcp_print(netdissect_options *ndo,
                 if (ip6) {
                         register struct tcp_seq_hash6 *th;
                         struct tcp_seq_hash6 *tcp_seq_hash;
-                        const struct in6_addr *src, *dst;
+                        const void *src, *dst;
                         struct tha6 tha;
 
                         tcp_seq_hash = tcp_seq_hash6;
-                        src = &ip6->ip6_src;
-                        dst = &ip6->ip6_dst;
+                        src = (const void *)&ip6->ip6_src;
+                        dst = (const void *)&ip6->ip6_dst;
                         if (sport > dport)
                                 rev = 1;
                         else if (sport == dport) {