Only probe for DNS64 presence when we know that we can talk to the slaacd
authorflorian <florian@openbsd.org>
Sun, 7 Feb 2021 13:35:41 +0000 (13:35 +0000)
committerflorian <florian@openbsd.org>
Sun, 7 Feb 2021 13:35:41 +0000 (13:35 +0000)
provided nameservers, i.e. the stub resolver check succeeded.
Previously we would only probe DNS64 on network change but would not
reschedule when it failed. Sometimes (most of the time?) this failes
because our address is still tentative or a default route has
not yet been installed.
OK phessler

sbin/unwind/resolver.c

index cc9019b..2db2e72 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: resolver.c,v 1.142 2021/02/06 18:01:02 florian Exp $  */
+/*     $OpenBSD: resolver.c,v 1.143 2021/02/07 13:35:41 florian Exp $  */
 
 /*
  * Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -1142,6 +1142,8 @@ new_resolver(enum uw_resolver_type type, enum uw_resolver_state state)
                /* FALLTHROUGH */
        case RESOLVING:
                resolvers[type]->state = state;
+               if (type == UW_RES_ASR)
+                       check_dns64();
                break;
        }
 }
@@ -2053,7 +2055,6 @@ replace_autoconf_forwarders(struct imsg_rdns_proposal *rdns_proposal)
                new_resolver(UW_RES_ASR, UNKNOWN);
                new_resolver(UW_RES_DHCP, UNKNOWN);
                new_resolver(UW_RES_ODOT_DHCP, UNKNOWN);
-               check_dns64();
        } else {
                while ((tmp = TAILQ_FIRST(&new_forwarder_list)) != NULL) {
                        TAILQ_REMOVE(&new_forwarder_list, tmp, entry);