From 796a6c947951a5a4459545b99bf97e0523f71402 Mon Sep 17 00:00:00 2001 From: Martin Nagy Date: Thu, 10 Dec 2009 22:23:04 +0100 Subject: Don't consider one address with different port numbers as the same There were two problems with the code. We were using fo_set_server_status() instead of fo_set_port_status() when we failed to connect to a service. This is a problem because if two services use the same server, or we want to use one server with two different ports, marking the whole server as bad is incorrect. The other problem was that be_resolve_server_done() was comparing the hostent structures -- these are, however, equal across multiple server:port pairs with the same server addresses. Fixes: #321 --- server/providers/ldap/sdap_async_connection.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server/providers/ldap/sdap_async_connection.c') diff --git a/server/providers/ldap/sdap_async_connection.c b/server/providers/ldap/sdap_async_connection.c index b742471c6..134979039 100644 --- a/server/providers/ldap/sdap_async_connection.c +++ b/server/providers/ldap/sdap_async_connection.c @@ -1051,13 +1051,15 @@ int sdap_cli_connect_recv(struct tevent_req *req, if (tevent_req_is_error(req, &tstate, &err)) { /* mark the server as bad if connection failed */ if (state->srv) { - fo_set_server_status(state->srv, SERVER_NOT_WORKING); + fo_set_port_status(state->srv, PORT_NOT_WORKING); } if (tstate == TEVENT_REQ_USER_ERROR) { return err; } return EIO; + } else if (state->srv) { + fo_set_port_status(state->srv, PORT_WORKING); } if (gsh) { -- cgit