public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: passt-dev@passt.top, Andrea Bolognani <abologna@redhat.com>
Subject: Re: [PATCH 1/3] udp: Actually use host resolver to forward DNS queries
Date: Mon, 27 Feb 2023 23:02:08 +1100	[thread overview]
Message-ID: <Y/ybwNIXvyCkHWjG@yekko> (raw)
In-Reply-To: <20230223170800.3888094-2-sbrivio@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1806 bytes --]

On Thu, Feb 23, 2023 at 06:07:58PM +0100, Stefano Brivio wrote:
> Instead of the address of the first resolver we advertise to
> the guest or namespace.
> 
> This was one of the intentions behind commit 3a2afde87dd1 ("conf,
> udp: Drop mostly duplicated dns_send arrays, rename related fields"),
> but I forgot to implement this part. In practice, they are usually
> the same thing, unless /etc/resolv.conf points to a loopback address.
> 
> Fixes: 3a2afde87dd1 ("conf, udp: Drop mostly duplicated dns_send arrays, rename related fields")
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  udp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/udp.c b/udp.c
> index c913d27..1d65559 100644
> --- a/udp.c
> +++ b/udp.c
> @@ -867,7 +867,7 @@ int udp_tap_handler(struct ctx *c, int af, const void *addr,
>  		} else if (IN4_ARE_ADDR_EQUAL(&s_in.sin_addr,
>  					      &c->ip4.dns_match) &&
>  			   ntohs(s_in.sin_port) == 53) {
> -			s_in.sin_addr = c->ip4.dns[0];
> +			s_in.sin_addr = c->ip4.dns_host;
>  		}
>  	} else {
>  		s_in6 = (struct sockaddr_in6) {
> @@ -890,7 +890,7 @@ int udp_tap_handler(struct ctx *c, int af, const void *addr,
>  				s_in6.sin6_addr = c->ip6.addr_seen;
>  		} else if (IN6_ARE_ADDR_EQUAL(addr, &c->ip6.dns_match) &&
>  			   ntohs(s_in6.sin6_port) == 53) {
> -			s_in6.sin6_addr = c->ip6.dns[0];
> +			s_in6.sin6_addr = c->ip6.dns_host;
>  		} else if (IN6_IS_ADDR_LINKLOCAL(&s_in6.sin6_addr)) {
>  			bind_addr = &c->ip6.addr_ll;
>  		}

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-02-27 13:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23 17:07 [PATCH 0/3] Allow non-127.0.0.1 loopback address as host resolver Stefano Brivio
2023-02-23 17:07 ` [PATCH 1/3] udp: Actually use host resolver to forward DNS queries Stefano Brivio
2023-02-27 12:02   ` David Gibson [this message]
2023-02-23 17:07 ` [PATCH 2/3] conf: Split add_dns{4,6}() out of get_dns() Stefano Brivio
2023-02-27 12:04   ` David Gibson
2023-02-23 17:08 ` [PATCH 3/3] conf, udp: Allow any loopback address to be used as resolver Stefano Brivio
2023-02-27 12:07   ` David Gibson
2023-02-23 17:53 ` [PATCH 0/3] Allow non-127.0.0.1 loopback address as host resolver Andrea Bolognani

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=Y/ybwNIXvyCkHWjG@yekko \
    --to=david@gibson.dropbear.id.au \
    --cc=abologna@redhat.com \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

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 IMAP folder(s).