summaryrefslogtreecommitdiff
path: root/slirp/ip6.h
diff options
context:
space:
mode:
authorGuillaume Subiron <maethor@subiron.org>2016-03-15 10:31:22 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-03-15 10:35:22 +0100
commit05061d8548598c92bda94de0c6159732e75da719 (patch)
treef9d78daeea7d03a31ef4bb0ff7fdb1f8494bade1 /slirp/ip6.h
parent3feea4447f1b9b04816ee6977b5ecc0eb704e07a (diff)
downloadqemu-05061d8548598c92bda94de0c6159732e75da719.tar.gz
slirp: Adding IPv6 address for DNS relay
This patch adds an IPv6 address to the DNS relay. in6_equal_dns() is developed using this Slirp attribute. sotranslate_in/out/accept() are also updated to manage the IPv6 case so the guest can be able to join the host using one of the Slirp addresses. For now this only points to localhost. Further development will be needed to automatically fetch the IPv6 address from resolv.conf, and announce this via RDNSS. Signed-off-by: Guillaume Subiron <maethor@subiron.org> 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.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/slirp/ip6.h b/slirp/ip6.h
index 731ee72d77..8ddfa242c4 100644
--- a/slirp/ip6.h
+++ b/slirp/ip6.h
@@ -72,7 +72,11 @@ static inline bool in6_equal_mach(const struct in6_addr *a,
|| (in6_equal_net(a, &(struct in6_addr)LINKLOCAL_ADDR, 64)\
&& in6_equal_mach(a, &slirp->vhost_addr6, 64)))
-#define in6_equal_dns(a) 0
+#define in6_equal_dns(a)\
+ ((in6_equal_net(a, &slirp->vprefix_addr6, slirp->vprefix_len)\
+ && in6_equal_mach(a, &slirp->vnameserver_addr6, slirp->vprefix_len))\
+ || (in6_equal_net(a, &(struct in6_addr)LINKLOCAL_ADDR, 64)\
+ && in6_equal_mach(a, &slirp->vnameserver_addr6, 64)))
#define in6_equal_host(a)\
(in6_equal_router(a) || in6_equal_dns(a))