|
|
f07426 |
From 0dfc25b917f7e94ac56ea4285a5d394305787b06 Mon Sep 17 00:00:00 2001
|
|
|
f07426 |
From: Stefano Brivio <sbrivio@redhat.com>
|
|
|
f07426 |
Date: Thu, 23 Feb 2023 12:21:29 +0000
|
|
|
f07426 |
Subject: [PATCH 01/20] udp: Actually use host resolver to forward DNS queries
|
|
|
f07426 |
|
|
|
f07426 |
Instead of the address of the first resolver we advertise to
|
|
|
f07426 |
the guest or namespace.
|
|
|
f07426 |
|
|
|
f07426 |
This was one of the intentions behind commit 3a2afde87dd1 ("conf,
|
|
|
f07426 |
udp: Drop mostly duplicated dns_send arrays, rename related fields"),
|
|
|
f07426 |
but I forgot to implement this part. In practice, they are usually
|
|
|
f07426 |
the same thing, unless /etc/resolv.conf points to a loopback address.
|
|
|
f07426 |
|
|
|
f07426 |
Fixes: 3a2afde87dd1 ("conf, udp: Drop mostly duplicated dns_send arrays, rename related fields")
|
|
|
f07426 |
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
|
|
|
f07426 |
Tested-by: Andrea Bolognani <abologna@redhat.com>
|
|
|
f07426 |
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
|
|
|
f07426 |
(cherry picked from commit ddf7097a718095e879428667f2d56ec7d4f027e5)
|
|
|
f07426 |
---
|
|
|
f07426 |
udp.c | 4 ++--
|
|
|
f07426 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
f07426 |
|
|
|
f07426 |
diff --git a/udp.c b/udp.c
|
|
|
f07426 |
index c913d27..1d65559 100644
|
|
|
f07426 |
--- a/udp.c
|
|
|
f07426 |
+++ b/udp.c
|
|
|
f07426 |
@@ -867,7 +867,7 @@ int udp_tap_handler(struct ctx *c, int af, const void *addr,
|
|
|
f07426 |
} else if (IN4_ARE_ADDR_EQUAL(&s_in.sin_addr,
|
|
|
f07426 |
&c->ip4.dns_match) &&
|
|
|
f07426 |
ntohs(s_in.sin_port) == 53) {
|
|
|
f07426 |
- s_in.sin_addr = c->ip4.dns[0];
|
|
|
f07426 |
+ s_in.sin_addr = c->ip4.dns_host;
|
|
|
f07426 |
}
|
|
|
f07426 |
} else {
|
|
|
f07426 |
s_in6 = (struct sockaddr_in6) {
|
|
|
f07426 |
@@ -890,7 +890,7 @@ int udp_tap_handler(struct ctx *c, int af, const void *addr,
|
|
|
f07426 |
s_in6.sin6_addr = c->ip6.addr_seen;
|
|
|
f07426 |
} else if (IN6_ARE_ADDR_EQUAL(addr, &c->ip6.dns_match) &&
|
|
|
f07426 |
ntohs(s_in6.sin6_port) == 53) {
|
|
|
f07426 |
- s_in6.sin6_addr = c->ip6.dns[0];
|
|
|
f07426 |
+ s_in6.sin6_addr = c->ip6.dns_host;
|
|
|
f07426 |
} else if (IN6_IS_ADDR_LINKLOCAL(&s_in6.sin6_addr)) {
|
|
|
f07426 |
bind_addr = &c->ip6.addr_ll;
|
|
|
f07426 |
}
|
|
|
f07426 |
--
|
|
|
f07426 |
2.39.2
|
|
|
f07426 |
|