From cf4832d01069c7c91744ace97b6566c24b5ab7bc Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 11 Jul 2011 14:58:41 +0200 Subject: s3:winbindd_cm: make use of cli->dest_ss instead calling getpeername() metze --- source3/winbindd/winbindd_cm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index a14fe13f74..2f78d7ae8f 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -1442,6 +1442,8 @@ static void store_current_dc_in_gencache(const char *domain_name, struct cli_state *cli) { char addr[INET6_ADDRSTRLEN]; + const struct sockaddr *sa; + socklen_t sa_len; char *key = NULL; char *value = NULL; @@ -1449,7 +1451,11 @@ static void store_current_dc_in_gencache(const char *domain_name, return; } - get_peer_addr(cli->fd, addr, sizeof(addr)); + sa = (const struct sockaddr *)(void *)&cli->dest_ss; + sa_len = sizeof(cli->dest_ss); + + print_sockaddr_len(addr, sizeof(addr), + sa, sa_len); key = current_dc_key(talloc_tos(), domain_name); if (key == NULL) { -- cgit