resolved: use CLAMP() intsead of MIN(MAX())
authorLennart Poettering <lennart@poettering.net>
Tue, 29 Dec 2015 18:08:22 +0000 (19:08 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 29 Dec 2015 20:42:10 +0000 (21:42 +0100)
src/resolve/resolved-dns-server.c

index a57385d..fbd1c27 100644 (file)
@@ -253,7 +253,7 @@ void dns_server_packet_received(DnsServer *s, DnsServerFeatureLevel level, usec_
 
         if (s->max_rtt < rtt) {
                 s->max_rtt = rtt;
-                s->resend_timeout = MIN(MAX(DNS_TIMEOUT_MIN_USEC, s->max_rtt * 2), DNS_TIMEOUT_MAX_USEC);
+                s->resend_timeout = CLAMP(s->max_rtt * 2, DNS_TIMEOUT_MIN_USEC, DNS_TIMEOUT_MAX_USEC);
         }
 }