aboutsummaryrefslogtreecommitdiff
path: root/slirp/ip6.h
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-03-20 15:09:09 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-07-03 23:27:08 +0200
commit1d17654e762ed1e31bfb16915fd03499c03d2063 (patch)
treec39ce52e46973ad34720b2e7fb181e489c17614b /slirp/ip6.h
parent972487b878dbdbdc9402208aace41c9573aa6c8b (diff)
downloadqemu-1d17654e762ed1e31bfb16915fd03499c03d2063.zip
qemu-1d17654e762ed1e31bfb16915fd03499c03d2063.tar.gz
qemu-1d17654e762ed1e31bfb16915fd03499c03d2063.tar.bz2
slirp: Add dns6 resolution
This makes get_dns_addr address family-agnostic, thus allowing to add the IPv6 case. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'slirp/ip6.h')
-rw-r--r--slirp/ip6.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/slirp/ip6.h b/slirp/ip6.h
index 8ddfa24..da23de6 100644
--- a/slirp/ip6.h
+++ b/slirp/ip6.h
@@ -26,6 +26,12 @@
0x00, 0x00, 0x00, 0x00,\
0x00, 0x00, 0x00, 0x02 } }
+#define ZERO_ADDR { .s6_addr = \
+ { 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00 } }
+
static inline bool in6_equal(const struct in6_addr *a, const struct in6_addr *b)
{
return memcmp(a, b, sizeof(*a)) == 0;
@@ -84,6 +90,9 @@ static inline bool in6_equal_mach(const struct in6_addr *a,
#define in6_solicitednode_multicast(a)\
(in6_equal_net(a, &(struct in6_addr)SOLICITED_NODE_PREFIX, 104))
+#define in6_zero(a)\
+ (in6_equal(a, &(struct in6_addr)ZERO_ADDR))
+
/* Compute emulated host MAC address from its ipv6 address */
static inline void in6_compute_ethaddr(struct in6_addr ip,
uint8_t eth[ETH_ALEN])