]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: drop unnecessary else, and add short comment
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 3 Jul 2022 20:34:25 +0000 (05:34 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 8 Jul 2022 20:20:09 +0000 (05:20 +0900)
src/resolve/resolved-dns-transaction.c

index 30429cd9b69658ae8b4b9b67131461587ebb6bff..8dfad1dc7d3b3c482aa5d5760fb0aacf9bf4f402 100644 (file)
@@ -1568,11 +1568,12 @@ static usec_t transaction_get_resend_timeout(DnsTransaction *t) {
                 return DNS_TIMEOUT_USEC;
 
         case DNS_PROTOCOL_MDNS:
-                assert(t->n_attempts > 0);
                 if (t->probing)
                         return MDNS_PROBING_INTERVAL_USEC;
-                else
-                        return (1 << (t->n_attempts - 1)) * USEC_PER_SEC;
+
+                /* See RFC 6762 Section 5.1 suggests that timeout should be a few seconds. */
+                assert(t->n_attempts > 0);
+                return (1 << (t->n_attempts - 1)) * USEC_PER_SEC;
 
         case DNS_PROTOCOL_LLMNR:
                 return t->scope->resend_timeout;