diff options
author | Jeffrey Hutzelman <jhutz@cmu.edu> | 2013-03-05 00:55:38 -0500 |
---|---|---|
committer | Jeffrey Hutzelman <jhutz@cmu.edu> | 2013-03-18 20:31:37 -0400 |
commit | f3c9dee12549bc0a55c8c4fcc6f72f8e3e87fefd (patch) | |
tree | 2e8524ee807fbed891e120d075b43bd103b7ae4a /server | |
parent | c195dcb983c774ead4320476fe6b4c362ebe351e (diff) |
server: Recheck other-realm server addresses daily
We currently have no support for obeying the TTLs on DNS records
containing the addresses of servers in other realms. For now, kludge
around this by rechecking these addresses once a day whether we need
to or not.
Diffstat (limited to 'server')
-rw-r--r-- | server/realm.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/server/realm.c b/server/realm.c index 085c0ce..494c2e4 100644 --- a/server/realm.c +++ b/server/realm.c @@ -193,15 +193,16 @@ rlm_server_address_lookup_cb(void *arg, int status, int timeouts, struct hostent *hp) { ZRealm_server *srvr = arg; + int delay = 30; if (status == ARES_SUCCESS) { rlm_set_server_address(srvr, hp); - return; + delay = 24 * 3600; /* Check again once per day */ + } else { + syslog(LOG_WARNING, "%s: hostname lookup failed: %s", + srvr->name->string, ares_strerror(status)); } - syslog(LOG_WARNING, "%s: hostname lookup failed: %s", - srvr->name->string, ares_strerror(status)); - /* * Set a timer to trigger another lookup. * But, not if the server is deleted, which may have happened @@ -214,7 +215,7 @@ rlm_server_address_lookup_cb(void *arg, int status, int timeouts, * lookup in progress. */ if (!srvr->timer && !srvr->deleted) - srvr->timer = timer_set_rel(30, rlm_server_address_timer_cb, arg); + srvr->timer = timer_set_rel(delay, rlm_server_address_timer_cb, arg); } #else |