diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-01-30 21:51:01 +0100 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-01-30 22:17:36 +0100 |
commit | 7755951df76e2d6183005414f6908e5eb5eee335 (patch) | |
tree | c53863fd077ee406a72b4bf5a28abfb855f166fa /ip6.h | |
parent | 470c75a397f10d35abb4b6ad4e2841b73d931fe3 (diff) | |
download | tcpdump-7755951df76e2d6183005414f6908e5eb5eee335.tar.gz |
RT6: Replace 'struct in6_addr' members type with a 'nd_ipv6' one
In 'struct ip6_hdr', 'struct ip6_rthdr0' and 'struct ip6_srh'.
This avoid some 'undefined-behavior' warnings with clang and option
-fsanitize=undefined enabled.
print-rt6.c:66:3: runtime error: member access within misaligned address
0x61d00001eab6 for type 'const struct ip6_rthdr0', which requires 4 byte
alignment
0x61d00001eab6: note: pointer points here
00 00 00 04 3a 02 00 01 00 00 00 00 22 00 00 00 00 00 02 10 00 02 00 00 00 00 00 04 80 00 d3 ab
^
SUMMARY: AddressSanitizer: undefined-behavior print-rt6.c:66:3 in
Diffstat (limited to 'ip6.h')
-rw-r--r-- | ip6.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -83,8 +83,8 @@ struct ip6_hdr { } ip6_un1; nd_uint8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */ } ip6_ctlun; - struct in6_addr ip6_src; /* source address */ - struct in6_addr ip6_dst; /* destination address */ + nd_ipv6 ip6_src; /* source address */ + nd_ipv6 ip6_dst; /* destination address */ } ND_UNALIGNED; #define ip6_vfc ip6_ctlun.ip6_un2_vfc @@ -184,7 +184,7 @@ struct ip6_rthdr0 { 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 */ + nd_ipv6 ip6r0_addr[1]; /* up to 23 addresses */ }; /** @@ -199,7 +199,7 @@ struct ip6_srh { nd_uint8_t srh_last_ent; /* Last Entry*/ nd_uint8_t srh_flags; /* Flags */ nd_uint16_t srh_tag; /* Tag */ - struct in6_addr srh_segments[1]; /* SRH segments list*/ + nd_ipv6 srh_segments[1]; /* SRH segments list*/ }; /* Fragment header */ |