aboutgitcodebugslistschat
path: root/conf.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-08-21 14:20:05 +1000
committerStefano Brivio <sbrivio@redhat.com>2024-08-21 12:00:06 +0200
commita6066f4e27b4d731c8903b091866bf2051586bf7 (patch)
tree4fe4e774d4e16be96eab401201b5d3558a5692fe /conf.c
parent7c083ee41c9aaa92d1215c6cef87bcd4eb6e20a7 (diff)
downloadpasst-a6066f4e27b4d731c8903b091866bf2051586bf7.tar
passt-a6066f4e27b4d731c8903b091866bf2051586bf7.tar.gz
passt-a6066f4e27b4d731c8903b091866bf2051586bf7.tar.bz2
passt-a6066f4e27b4d731c8903b091866bf2051586bf7.tar.lz
passt-a6066f4e27b4d731c8903b091866bf2051586bf7.tar.xz
passt-a6066f4e27b4d731c8903b091866bf2051586bf7.tar.zst
passt-a6066f4e27b4d731c8903b091866bf2051586bf7.zip
conf: Correct setting of dns_match address in add_dns6()
add_dns6() (but not add_dns4()) has a bug setting dns_match: it sets it to the given address, rather than the gateway address. This is doubly wrong: - We've just established the given address is a host loopback address the guest can't access - We've just set ip6.dns[] to tell the guest to use the gateway address, so it won't use the dns_match address we're setting Correct this to use the gateway address, like IPv4. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/conf.c b/conf.c
index 4bb06b7..bf61c14 100644
--- a/conf.c
+++ b/conf.c
@@ -408,7 +408,7 @@ static unsigned add_dns6(struct ctx *c, struct in6_addr *addr, unsigned idx)
added++;
if (IN6_IS_ADDR_UNSPECIFIED(&c->ip6.dns_match))
- c->ip6.dns_match = *addr;
+ c->ip6.dns_match = c->ip6.gw;
}
} else {
c->ip6.dns[idx] = *addr;