summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2015-08-28 16:48:37 +0200
committerDaniel Mack <daniel@zonque.org>2015-12-08 16:51:40 +0100
commit11a27c2ec1f3bdb1df828883365903ce47576c51 (patch)
tree3b8a12c7de865e1991a92af6d32a54b1c51c7b7e
parentef7ce6df4d5084bb0cba78e71a2bb932b59045e8 (diff)
resolved: handle mDNS timeouts per transaction
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.
-rw-r--r--src/resolve/resolved-dns-transaction.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c
index f8063b93f1..7c81c907f2 100644
--- a/src/resolve/resolved-dns-transaction.c
+++ b/src/resolve/resolved-dns-transaction.c
@@ -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.");