From 47d52632d2aaf93e685a6b7c9e3e43972998cf83 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Tue, 7 Aug 2012 15:32:05 +0200 Subject: Don't use server after SRV data collapsed --- src/providers/fail_over.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/providers') diff --git a/src/providers/fail_over.c b/src/providers/fail_over.c index faff32f7..facc9904 100644 --- a/src/providers/fail_over.c +++ b/src/providers/fail_over.c @@ -1061,17 +1061,20 @@ resolve_srv_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, state->ev = ev; state->resolv = resolv; state->fo_ctx = ctx; - state->meta = server; + state->meta = server->srv_data->meta; status = get_srv_data_status(server->srv_data); - DEBUG(6, ("The status of SRV lookup is %s\n", - str_srv_data_status(status))); + DEBUG(SSSDBG_FUNC_DATA, ("The status of SRV lookup is %s\n", + str_srv_data_status(status))); switch(status) { case SRV_EXPIRED: /* Need a refresh */ state->meta = collapse_srv_lookup(server); - /* FALLTHROUGH */ + /* FALLTHROUGH. + * "server" might be invalid now if the SRV + * query collapsed + * */ case SRV_NEUTRAL: /* Request SRV lookup */ - if (server->srv_data->dns_domain == NULL) { + if (state->meta->srv_data->dns_domain == NULL) { /* we need to look up our DNS domain first */ subreq = resolve_get_domain_send(state, ev, ctx, resolv); if (subreq == NULL) { -- cgit