From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id AAB1E5A0268 for ; Mon, 27 Feb 2023 14:29:58 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4PQLvg5lyWz4x90; Tue, 28 Feb 2023 00:29:51 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1677504591; bh=4qr7MS7hx0cXgmBmEcsZPPnodYPnPrhqTlzZoTuXdA4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AHgIh0AgJPbPBOLBO6zKVa9xjEExtleZoyfEEOG1/zQi54//LisKEUAY82hZU3Ekb Q0ei43iexXmovqX52Sv7t55Dl0ZFlh1E4guSm3watNv8BbJ+rswqBF+iS0XkLgmtiM l2nIMWju5jDZPxdCA0SYrR1xk8yoKZhea6RHxXrE= Date: Mon, 27 Feb 2023 23:02:08 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 1/3] udp: Actually use host resolver to forward DNS queries Message-ID: References: <20230223170800.3888094-1-sbrivio@redhat.com> <20230223170800.3888094-2-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3L+OhbT23CCkT/jk" Content-Disposition: inline In-Reply-To: <20230223170800.3888094-2-sbrivio@redhat.com> Message-ID-Hash: 7XDSFZ5HONFSYWMRF5SOUK7N3E4A7II6 X-Message-ID-Hash: 7XDSFZ5HONFSYWMRF5SOUK7N3E4A7II6 X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, Andrea Bolognani X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --3L+OhbT23CCkT/jk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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. >=20 > Fixes: 3a2afde87dd1 ("conf, udp: Drop mostly duplicated dns_send arrays, = rename related fields") > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > udp.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > 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) =3D=3D 53) { > - s_in.sin_addr =3D c->ip4.dns[0]; > + s_in.sin_addr =3D c->ip4.dns_host; > } > } else { > s_in6 =3D (struct sockaddr_in6) { > @@ -890,7 +890,7 @@ int udp_tap_handler(struct ctx *c, int af, const void= *addr, > s_in6.sin6_addr =3D c->ip6.addr_seen; > } else if (IN6_ARE_ADDR_EQUAL(addr, &c->ip6.dns_match) && > ntohs(s_in6.sin6_port) =3D=3D 53) { > - s_in6.sin6_addr =3D c->ip6.dns[0]; > + s_in6.sin6_addr =3D c->ip6.dns_host; > } else if (IN6_IS_ADDR_LINKLOCAL(&s_in6.sin6_addr)) { > bind_addr =3D &c->ip6.addr_ll; > } --=20 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 --3L+OhbT23CCkT/jk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmP8m7oACgkQzQJF27ox 2GfcchAAqbgffLPxoaQ8YBZmy2ScwiAT/lKhLDMorhiayb4xLxnxaoDvcJRgL/ru dvmOFvbIMErNs77N7bSD2nb3sezXaMu6KFpYA3aaXRlBzu8cRZ6z8AruQ+J+9cfE dUqikiEG5+GpZpTLMv5cngaabpOwLOYziy+kUov8SS6sQ6Tkld6VUDHPco7rwqJ+ LZpIWb4pn4MpSZ/VMLtWxuTw5dwINGHAYeLdJqaP/CggrgJz/IwuxUs9DJ3lsueo eI07+3kcvukSPf1igw6Zqyolne7XfUM5/baOdKBXilVXs1zXszicipxybFn/DOSE YG7NxckGkZaHBJmiFHJoqjSvXJBkOd+9UU1q3XsJ8bQlNKo1o+t+WS4Wo3c+OBd9 VmPXrJ9L/LJDcV8Yhp3f54t4NnDFbEZ31/AUevrsX3uxkIdftdwS6gZCkNRniUED l8BxIxCoB8SKwi9PRt+m2dFhXLgc/FUzW37z/olaNT/lXENEtDJ/yn8zuve5oU6u cKHC1563CTU83aRcXEoEAWJXEPNRCi3KgEJlYtXqBUlcWoIP7jDFOoPbKoY1qklP ZAdh40oL4sSe55ZaukLvhqzz/ejvHSwEr2ooHBWDA+6kOuL2nHaCYNDvpoSbnCLU ZUFJ5ReCn3yHlpYdWANASZZmpn+9VcTfMVLp0HjrkGKguwRmg+4= =8gGZ -----END PGP SIGNATURE----- --3L+OhbT23CCkT/jk--