aboutsummaryrefslogtreecommitdiff
path: root/slirp/ndp_table.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2018-01-08 14:28:55 -0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-01-14 18:16:13 +0100
commit1120fae0cfb0bd5697211bf66aed981c919a7683 (patch)
tree893b756af6e8559e2d3b92885293a3e79c6b0782 /slirp/ndp_table.c
parent7398166ddf7c6dbbc9cae6ac69bb2feda14b40ac (diff)
downloadqemu-1120fae0cfb0bd5697211bf66aed981c919a7683.zip
qemu-1120fae0cfb0bd5697211bf66aed981c919a7683.tar.gz
qemu-1120fae0cfb0bd5697211bf66aed981c919a7683.tar.bz2
slirp: avoid IN6_IS_ADDR_UNSPECIFIED(), rather use in6_zero()
Host: Mac OS 10.12.5 Compiler: Apple LLVM version 8.1.0 (clang-802.0.42) slirp/ip6_icmp.c:80:38: warning: taking address of packed member 'ip_src' of class or structure 'ip6' may result in an unaligned pointer value [-Waddress-of-packed-member] IN6_IS_ADDR_UNSPECIFIED(&ip->ip_src)) { ^~~~~~~~~~ /usr/include/netinet6/in6.h:238:42: note: expanded from macro 'IN6_IS_ADDR_UNSPECIFIED' ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ ^ Reported-by: John Arbuckle <programmingkidx@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/ndp_table.c')
-rw-r--r--slirp/ndp_table.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/slirp/ndp_table.c b/slirp/ndp_table.c
index 9d4c39b..e1676a0 100644
--- a/slirp/ndp_table.c
+++ b/slirp/ndp_table.c
@@ -23,7 +23,7 @@ void ndp_table_add(Slirp *slirp, struct in6_addr ip_addr,
ethaddr[0], ethaddr[1], ethaddr[2],
ethaddr[3], ethaddr[4], ethaddr[5]));
- if (IN6_IS_ADDR_MULTICAST(&ip_addr) || IN6_IS_ADDR_UNSPECIFIED(&ip_addr)) {
+ if (IN6_IS_ADDR_MULTICAST(&ip_addr) || in6_zero(&ip_addr)) {
/* Do not register multicast or unspecified addresses */
DEBUG_CALL(" abort: do not register multicast or unspecified address");
return;
@@ -60,7 +60,7 @@ bool ndp_table_search(Slirp *slirp, struct in6_addr ip_addr,
DEBUG_ARG("ip = %s", addrstr);
#endif
- assert(!IN6_IS_ADDR_UNSPECIFIED(&ip_addr));
+ assert(!in6_zero(&ip_addr));
/* Multicast address: fec0::abcd:efgh/8 -> 33:33:ab:cd:ef:gh */
if (IN6_IS_ADDR_MULTICAST(&ip_addr)) {