From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVyPW-0005sy-1L for qemu-devel@nongnu.org; Wed, 17 Feb 2016 04:28:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVyPR-0003b2-H9 for qemu-devel@nongnu.org; Wed, 17 Feb 2016 04:28:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVyPR-0003aw-BO for qemu-devel@nongnu.org; Wed, 17 Feb 2016 04:28:33 -0500 References: <043b3b699753317c270087536c8d239aae2432eb.1455471945.git.samuel.thibault@ens-lyon.org> From: Thomas Huth Message-ID: <56C43D3A.1080100@redhat.com> Date: Wed, 17 Feb 2016 10:28:26 +0100 MIME-Version: 1.0 In-Reply-To: <043b3b699753317c270087536c8d239aae2432eb.1455471945.git.samuel.thibault@ens-lyon.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCHv7 8/9] slirp: Adding IPv6 address for DNS relay List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Samuel Thibault , qemu-devel@nongnu.org Cc: zhanghailiang , Li Zhijian , Stefan Hajnoczi , Jason Wang , Dave Gilbert , Vasiliy Tolstov , Huangpeng , Gonglei , Jan Kiszka , Guillaume Subiron On 14.02.2016 18:47, Samuel Thibault wrote: > From: Guillaume Subiron >=20 > 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. >=20 > For now this only points to localhost. Further development will be need= ed to > automatically fetch the IPv6 address from resolv.conf, and announce thi= s via > RDNSS. >=20 > Signed-off-by: Guillaume Subiron > Signed-off-by: Samuel Thibault > --- > slirp/ip6.h | 5 ++++- > slirp/slirp.c | 1 + > slirp/slirp.h | 1 + > slirp/socket.c | 32 ++++++++++++++++++++++++++++++++ > 4 files changed, 38 insertions(+), 1 deletion(-) >=20 > diff --git a/slirp/ip6.h b/slirp/ip6.h > index 9f7623f..ded6d78 100644 > --- a/slirp/ip6.h > +++ b/slirp/ip6.h > @@ -70,7 +70,10 @@ static inline bool in6_equal_mach(const struct in6_a= ddr *a, > || (in6_equal_net(a, &(struct in6_addr)LINKLOCAL_ADDR, 64)\ > && in6_equal_mach(a, &slirp->vhost_addr6, 64))) > =20 > -#define in6_equal_dns(a) 0 > +#define in6_equal_dns(a)\ > + ((in6_equal_net(a, &slirp->vprefix_addr6, slirp->vprefix_len)\ > + || in6_equal_net(a, &(struct in6_addr)LINKLOCAL_ADDR, 64))\ > + && in6_equal_mach(a, &slirp->vnameserver_addr6, slirp->vprefix_le= n)) Does this work properly if vprefix_len < 64 ? I think this rather should be done similar to in6_equal_router(), i.e. something like: #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)) ? Thomas