summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-12-20 14:53:34 +0100
committerStephen Gallagher <sgallagh@redhat.com>2011-12-20 13:37:28 -0500
commitf76cb01f05f7c1764028084b166f65c3ff4e670f (patch)
treece57fff82d26ae60afe5bf87a7496efafe972731
parentf82ea00868e8917a9fb4f8e820817d8657370e46 (diff)
downloadsssd-f76cb01f05f7c1764028084b166f65c3ff4e670f.tar.gz
sssd-f76cb01f05f7c1764028084b166f65c3ff4e670f.tar.xz
sssd-f76cb01f05f7c1764028084b166f65c3ff4e670f.zip
Do not touch resolve_service_state in fo_resolve_service_done
-rw-r--r--src/providers/fail_over.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/providers/fail_over.c b/src/providers/fail_over.c
index 91d981cf5..5cfc1a41c 100644
--- a/src/providers/fail_over.c
+++ b/src/providers/fail_over.c
@@ -850,7 +850,8 @@ fo_resolve_service_server(struct tevent_req *req)
tevent_req_error(req, ENOMEM);
return true;
}
- tevent_req_set_callback(subreq, fo_resolve_service_done, req);
+ tevent_req_set_callback(subreq, fo_resolve_service_done,
+ state->server->common);
fo_set_server_status(state->server, SERVER_RESOLVING_NAME);
/* FALLTHROUGH */
case SERVER_RESOLVING_NAME:
@@ -873,34 +874,30 @@ fo_resolve_service_server(struct tevent_req *req)
static void
fo_resolve_service_done(struct tevent_req *subreq)
{
- struct tevent_req *req = tevent_req_callback_data(subreq,
- struct tevent_req);
- struct resolve_service_state *state = tevent_req_data(req,
- struct resolve_service_state);
- struct server_common *common;
+ struct server_common *common = tevent_req_callback_data(subreq,
+ struct server_common);
int resolv_status;
struct resolve_service_request *request;
int ret;
- if (state->server->common->rhostent != NULL) {
- talloc_zfree(state->server->common->rhostent);
+ if (common->rhostent != NULL) {
+ talloc_zfree(common->rhostent);
}
- ret = resolv_gethostbyname_recv(subreq, state->server->common,
+ ret = resolv_gethostbyname_recv(subreq, common,
&resolv_status, NULL,
- &state->server->common->rhostent);
+ &common->rhostent);
talloc_zfree(subreq);
if (ret != EOK) {
DEBUG(1, ("Failed to resolve server '%s': %s\n",
- state->server->common->name,
+ common->name,
resolv_strerror(resolv_status)));
- set_server_common_status(state->server->common, SERVER_NOT_WORKING);
+ set_server_common_status(common, SERVER_NOT_WORKING);
} else {
- set_server_common_status(state->server->common, SERVER_NAME_RESOLVED);
+ set_server_common_status(common, SERVER_NAME_RESOLVED);
}
/* Take care of all requests for this server. */
- common = state->server->common; /* state can disappear now */
while ((request = common->request_list) != NULL) {
DLIST_REMOVE(common->request_list, request);
if (resolv_status) {