diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-03-08 15:06:09 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-03-08 11:46:33 -0500 |
commit | 6a39087fc54c7fd53b834cf5a973c4d36cf9bd30 (patch) | |
tree | ae123a8efca91a65790415f5e7107abbf305a4f3 /src | |
parent | 76e46bf6e6a105d0224670db901a9e3910ed6df0 (diff) | |
download | sssd-6a39087fc54c7fd53b834cf5a973c4d36cf9bd30.tar.gz sssd-6a39087fc54c7fd53b834cf5a973c4d36cf9bd30.tar.xz sssd-6a39087fc54c7fd53b834cf5a973c4d36cf9bd30.zip |
Always expire host name resolution
The previous version of the patch only expired a resolved host name
if the port was being reset. We want to always expire it so we notice
IP address changes even if the previous server is still up.
Diffstat (limited to 'src')
-rw-r--r-- | src/providers/fail_over.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/providers/fail_over.c b/src/providers/fail_over.c index 37ffe268f..92089226b 100644 --- a/src/providers/fail_over.c +++ b/src/providers/fail_over.c @@ -318,8 +318,8 @@ get_server_status(struct fo_server *server) str_server_status(server->common->server_status))); timeout = server->service->ctx->opts->retry_timeout; + gettimeofday(&tv, NULL); if (timeout != 0 && server->common->server_status == SERVER_NOT_WORKING) { - gettimeofday(&tv, NULL); if (STATUS_DIFF(server->common, tv) > timeout) { DEBUG(4, ("Reseting the server status of '%s'\n", SERVER_NAME(server))); @@ -328,6 +328,12 @@ get_server_status(struct fo_server *server) } } + if (STATUS_DIFF(server->common, tv) > HOSTNAME_RESOLVE_TIMEOUT) { + DEBUG(4, ("Hostname resolution expired, reseting the server " + "status of '%s'\n", SERVER_NAME(server))); + fo_set_server_status(server, SERVER_NAME_NOT_RESOLVED); + } + return server->common->server_status; } @@ -352,13 +358,6 @@ get_port_status(struct fo_server *server) server->port, SERVER_NAME(server))); server->port_status = PORT_NEUTRAL; server->last_status_change.tv_sec = tv.tv_sec; - - if (server->common != NULL && - STATUS_DIFF(server->common, tv) > HOSTNAME_RESOLVE_TIMEOUT) { - DEBUG(4, ("Reseting the server status of '%s'\n", - SERVER_NAME(server))); - fo_set_server_status(server, SERVER_NAME_NOT_RESOLVED); - } } } |