qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCHv7 8/9] slirp: Adding IPv6 address for DNS relay


From: Thomas Huth
Subject: Re: [Qemu-devel] [PATCHv7 8/9] slirp: Adding IPv6 address for DNS relay
Date: Wed, 17 Feb 2016 10:28:26 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 14.02.2016 18:47, Samuel Thibault wrote:
> From: Guillaume Subiron <address@hidden>
> 
> 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 <address@hidden>
> Signed-off-by: Samuel Thibault <address@hidden>
> ---
>  slirp/ip6.h    |  5 ++++-
>  slirp/slirp.c  |  1 +
>  slirp/slirp.h  |  1 +
>  slirp/socket.c | 32 ++++++++++++++++++++++++++++++++
>  4 files changed, 38 insertions(+), 1 deletion(-)
> 
> 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_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_net(a, &(struct in6_addr)LINKLOCAL_ADDR, 64))\
> +     && in6_equal_mach(a, &slirp->vnameserver_addr6, slirp->vprefix_len))

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]