diff options
Diffstat (limited to 'src/tests/fail_over-tests.c')
-rw-r--r-- | src/tests/fail_over-tests.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/tests/fail_over-tests.c b/src/tests/fail_over-tests.c index 84016dd9b..4b1e5791b 100644 --- a/src/tests/fail_over-tests.c +++ b/src/tests/fail_over-tests.c @@ -170,13 +170,15 @@ test_resolve_service_callback(struct tevent_req *req) if (task->new_server_status >= 0) fo_set_server_status(server, task->new_server_status); - he = fo_get_server_hostent(server); - fail_if(he == NULL, "%s: fo_get_server_hostent() returned NULL"); - for (i = 0; he->addr_list[i]; i++) { - char buf[256]; - - inet_ntop(he->family, he->addr_list[i]->ipaddr, buf, sizeof(buf)); - fail_if(strcmp(buf, "127.0.0.1") != 0 && strcmp(buf, "::1") != 0); + if (fo_get_server_name(server) != NULL) { + he = fo_get_server_hostent(server); + fail_if(he == NULL, "%s: fo_get_server_hostent() returned NULL"); + for (i = 0; he->addr_list[i]; i++) { + char buf[256]; + + inet_ntop(he->family, he->addr_list[i]->ipaddr, buf, sizeof(buf)); + fail_if(strcmp(buf, "127.0.0.1") != 0 && strcmp(buf, "::1") != 0); + } } } |