]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: handle mDNS timeouts per transaction
authorDaniel Mack <daniel@zonque.org>
Fri, 28 Aug 2015 14:48:37 +0000 (16:48 +0200)
committerDaniel Mack <daniel@zonque.org>
Tue, 8 Dec 2015 15:51:40 +0000 (16:51 +0100)
mDNS packet timeouts need to be handled per transaction, not per link.
Re-use the n_attempts field for this purpose, as packets timeouts should be
determined by starting at 1 second, and doubling the value on each try.

src/resolve/resolved-dns-transaction.c

index f8063b93f1d8481df04f559a9f63dbfae0120f37..7c81c907f20965650ba3b8d9d996f12edd39805f 100644 (file)
@@ -656,8 +656,10 @@ static usec_t transaction_get_resend_timeout(DnsTransaction *t) {
                 assert(t->server);
 
                 return t->server->resend_timeout;
-        case DNS_PROTOCOL_LLMNR:
         case DNS_PROTOCOL_MDNS:
+                assert(t->n_attempts > 0);
+                return (1 << (t->n_attempts - 1)) * USEC_PER_SEC;
+        case DNS_PROTOCOL_LLMNR:
                 return t->scope->resend_timeout;
         default:
                 assert_not_reached("Invalid DNS protocol.");