From 2b1fc7c0d30b6fbef3cb61775f37062fdc2c9656 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 21 Jul 2011 21:51:11 +0200 Subject: s3:winbindd_cm: remove unused checks for address family If we got a connection, we don't need to check what address family it uses. metze Autobuild-User: Stefan Metzmacher Autobuild-Date: Thu Jul 21 23:33:48 CEST 2011 on sn-devel-104 --- source3/winbindd/winbindd_cm.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index 25f639872e..7df6bf8160 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -792,12 +792,6 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain, NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - struct sockaddr peeraddr; - socklen_t peeraddr_len; - - struct sockaddr_in *peeraddr_in = - (struct sockaddr_in *)(void *)&peeraddr; - DEBUG(10,("cm_prepare_connection: connecting to DC %s for domain %s\n", controller, domain->name )); @@ -823,37 +817,6 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain, (*cli)->use_kerberos = True; - peeraddr_len = sizeof(peeraddr); - - if ((getpeername((*cli)->fd, &peeraddr, &peeraddr_len) != 0)) { - DEBUG(0,("cm_prepare_connection: getpeername failed with: %s\n", - strerror(errno))); - result = NT_STATUS_UNSUCCESSFUL; - goto done; - } - - if ((peeraddr_len != sizeof(struct sockaddr_in)) -#ifdef HAVE_IPV6 - && (peeraddr_len != sizeof(struct sockaddr_in6)) -#endif - ) { - DEBUG(0,("cm_prepare_connection: got unexpected peeraddr len %d\n", - peeraddr_len)); - result = NT_STATUS_UNSUCCESSFUL; - goto done; - } - - if ((peeraddr_in->sin_family != PF_INET) -#ifdef HAVE_IPV6 - && (peeraddr_in->sin_family != PF_INET6) -#endif - ) { - DEBUG(0,("cm_prepare_connection: got unexpected family %d\n", - peeraddr_in->sin_family)); - result = NT_STATUS_UNSUCCESSFUL; - goto done; - } - result = cli_negprot(*cli); if (!NT_STATUS_IS_OK(result)) { -- cgit