summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2023-02-14 11:39:07 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2023-02-21 13:55:30 +0100
commit0ebd75381963abc2fb75d39ab44367139db0e34b (patch)
treeca097f0d2b61caba18b6706c875a069e86b8358c
parent41cd94f46af5a965ed3c84f09748194b5b7f3517 (diff)
device: skip DNS resolution for tentative IPv6 addresses
A tentative IPv6 address can still fail DAD, so don't use it to resolve the hostname via DNS. Furthermore, tentative addresses can't be used to contact the nameserver and so the resolution will fail if there is no other valid IPv6 address. Wait that the address becomes non-tentative. (cherry picked from commit 4138be6a5a508af66b3b79c0eaeb43e3437ee345)
-rw-r--r--src/core/devices/nm-device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
index 291fb279fc..4a9c43eac6 100644
--- a/src/core/devices/nm-device.c
+++ b/src/core/devices/nm-device.c
@@ -17242,6 +17242,9 @@ get_address_for_hostname_dns_lookup(NMDevice *self, int addr_family)
return g_inet_address_new_from_bytes(addr->ax.address_ptr, G_SOCKET_FAMILY_IPV4);
}
+ if (addr->ax.n_ifa_flags & IFA_F_TENTATIVE)
+ continue;
+
/* For IPv6 prefer, in order:
* - !link-local, !deprecated
* - !link-local, deprecated