]> The Tcpdump Group git mirrors - tcpdump/commit
ICMP: Replace a 'struct in_addr' member type with a 'nd_ipv4' one
authorFrancois-Xavier Le Bail <[email protected]>
Tue, 30 Jan 2018 14:51:20 +0000 (15:51 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Tue, 30 Jan 2018 15:38:48 +0000 (16:38 +0100)
commitaa9960a2c3d98c38d385c10e54d9160cb89feba0
treec30a1db530c9d83ddfce03cfcac9b0da1afe8a2c
parentfbe65c7e385eb914cc86ea3e1cf278f4179203b2
ICMP: Replace a 'struct in_addr' member type with a 'nd_ipv4' one

In 'struct icmp'.
This avoid some 'undefined-behavior' warnings with clang and option
-fsanitize=undefined enabled.

Moreover:
Remove unneeded '&' when getting a pointer to a nd_ipv4 type.
Fix indentation.

The warnings were like:
print-icmp.c:355:2: runtime error: member access within misaligned address
0x61d00001eabe for type 'const struct icmp', which requires 4 byte alignment
0x61d00001eabe: note: pointer points here
 ef 01 02 03 08 00  90 e1 00 03 00 00 00 00  00 00 00 05 ed 60 ab cd  ab cd ab cd ab cd ab cd  ab cd
             ^
SUMMARY: AddressSanitizer: undefined-behavior print-icmp.c:355:2 in
print-icmp.c