qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	qemu-devel@nongnu.org, jasowang@redhat.com,
	marcandre.lureau@gmail.com, philmd@redhat.com
Subject: Re: [PATCHv2] slirp: Allow non-local DNS address when restrict is off
Date: Tue, 1 Oct 2019 17:57:34 +0200	[thread overview]
Message-ID: <e5f8099f-10bd-5855-8ec4-91c3312d36a9@redhat.com> (raw)
In-Reply-To: <20191001154057.27250-1-samuel.thibault@ens-lyon.org>

On 01/10/2019 17.40, Samuel Thibault wrote:
> This can be used to set a DNS server to be used by the guest which is
> different from the one configured on the host.
> 
> Buglink: https://bugs.launchpad.net/qemu/+bug/1010484
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> ---
> Difference from first version:
> - handle DNS IPv6 as well
> - reference bug with Buglink
> 
>  net/slirp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/slirp.c b/net/slirp.c
> index f42f496641..c4334ee876 100644
> --- a/net/slirp.c
> +++ b/net/slirp.c
> @@ -456,7 +456,7 @@ static int net_slirp_init(NetClientState *peer, const char *model,
>          error_setg(errp, "Failed to parse DNS");
>          return -1;
>      }
> -    if ((dns.s_addr & mask.s_addr) != net.s_addr) {
> +    if (restricted && (dns.s_addr & mask.s_addr) != net.s_addr) {
>          error_setg(errp, "DNS doesn't belong to network");
>          return -1;
>      }
> @@ -522,7 +522,7 @@ static int net_slirp_init(NetClientState *peer, const char *model,
>              error_setg(errp, "Failed to parse IPv6 DNS");
>              return -1;
>          }
> -        if (!in6_equal_net(&ip6_prefix, &ip6_dns, vprefix6_len)) {
> +        if (restricted && !in6_equal_net(&ip6_prefix, &ip6_dns, vprefix6_len)) {
>              error_setg(errp, "IPv6 DNS doesn't belong to network");
>              return -1;
>          }
> 

Makes sense.

Reviewed-by: Thomas Huth <thuth@redhat.com>


      parent reply	other threads:[~2019-10-01 16:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01 15:40 [PATCHv2] slirp: Allow non-local DNS address when restrict is off Samuel Thibault
2019-10-01 15:44 ` Philippe Mathieu-Daudé
2019-10-01 15:57 ` Thomas Huth [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e5f8099f-10bd-5855-8ec4-91c3312d36a9@redhat.com \
    --to=thuth@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=samuel.thibault@ens-lyon.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).