summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2015-03-03 11:39:39 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-03-03 16:31:51 +0100
commit75c2f20d1fc854e99f464098a23fe8cc3949fcb3 (patch)
treeb475dc262f76ee166d5da7f4ef5d6c9b480d3b70
parentfcb087c3a51b665d96f10fb03cfb889cc441e0ae (diff)
downloadsssd-75c2f20d1fc854e99f464098a23fe8cc3949fcb3.tar.gz
sssd-75c2f20d1fc854e99f464098a23fe8cc3949fcb3.tar.xz
sssd-75c2f20d1fc854e99f464098a23fe8cc3949fcb3.zip
resolv: Use the same default timeout for SRV queries as previously
When we changed the resolver code to use the TTL values from the DNS queries instead of harcoded ones, we changed the default value by accident. Add a separate SRV TTL that is backwards-compatible with the old harcoded value. Reviewed-by: Pavel Březina <pbrezina@redhat.com> (cherry picked from commit eafbc66c2ff6365478e62a8df3fd005bf80e5c7b)
-rw-r--r--src/resolv/async_resolv.c4
-rw-r--r--src/resolv/async_resolv.h4
2 files changed, 7 insertions, 1 deletions
diff --git a/src/resolv/async_resolv.c b/src/resolv/async_resolv.c
index 85c4d99a4..80e4922c5 100644
--- a/src/resolv/async_resolv.c
+++ b/src/resolv/async_resolv.c
@@ -1776,8 +1776,10 @@ resolv_getsrv_done(void *arg, int status, int timeouts, unsigned char *abuf, int
state->reply_list = reply_list;
ok = resolv_get_ttl(abuf, alen, &state->ttl);
if (ok == false) {
- state->ttl = RESOLV_DEFAULT_TTL;
+ DEBUG(SSSDBG_MINOR_FAILURE, "Could not read TTL, using the default..\n");
+ state->ttl = RESOLV_DEFAULT_SRV_TTL;
}
+ DEBUG(SSSDBG_TRACE_LIBS, "Using TTL [%"PRIu32"]\n", state->ttl);
tevent_req_done(req);
return;
diff --git a/src/resolv/async_resolv.h b/src/resolv/async_resolv.h
index 9b08f12ae..14cbdc502 100644
--- a/src/resolv/async_resolv.h
+++ b/src/resolv/async_resolv.h
@@ -42,6 +42,10 @@
#define RESOLV_DEFAULT_TTL 7200
#endif /* RESOLV_DEFAULT_TTL */
+#ifndef RESOLV_DEFAULT_SRV_TTL
+#define RESOLV_DEFAULT_SRV_TTL 14400
+#endif /* RESOLV_DEFAULT_SRV_TTL */
+
#include "util/util.h"
/*