[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2166-g4b0658d

Jeremy Allison jra at samba.org
Mon Jun 8 22:24:40 GMT 2009


The branch, master has been updated
       via  4b0658d4486d60c82c989ed0b6c806dfc45edbac (commit)
      from  89bd09e7f3247b02223bd06a68be43b8954f5b97 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 4b0658d4486d60c82c989ed0b6c806dfc45edbac
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jun 8 15:21:48 2009 -0700

    Replace the "ipv4" specific strings in libcli/cldap/cldap.c with "ip". CLDAP can
    run over IPv4/IPv6, even though some of the netlogon messages are IPv4 specific.
    Fix the new ads_cldap_netlogon() to be IPv6/IPv4 agnostic. This compiles but
    I don't have a good test env. for this (although as the previous code was
    *completely* broken over IPv6 this will expose previously hidden bugs if it's broken :-).
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 libcli/cldap/cldap.c   |    4 ++--
 source3/libads/cldap.c |   21 ++++++---------------
 2 files changed, 8 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/cldap/cldap.c b/libcli/cldap/cldap.c
index 8a0c2ee..191d0ee 100644
--- a/libcli/cldap/cldap.c
+++ b/libcli/cldap/cldap.c
@@ -320,7 +320,7 @@ NTSTATUS cldap_socket_init(TALLOC_CTX *mem_ctx,
 	c->event.ctx = ev;
 
 	if (!local_addr) {
-		ret = tsocket_address_inet_from_strings(c, "ipv4",
+		ret = tsocket_address_inet_from_strings(c, "ip",
 							NULL, 0,
 							&any);
 		if (ret != 0) {
@@ -550,7 +550,7 @@ struct tevent_req *cldap_search_send(TALLOC_CTX *mem_ctx,
 			goto post;
 		}
 		ret = tsocket_address_inet_from_strings(state,
-						        "ipv4",
+						        "ip",
 						        io->in.dest_address,
 						        io->in.dest_port,
 							&state->request.dest);
diff --git a/source3/libads/cldap.c b/source3/libads/cldap.c
index 4c3716a..5230207 100644
--- a/source3/libads/cldap.c
+++ b/source3/libads/cldap.c
@@ -38,29 +38,20 @@ bool ads_cldap_netlogon(TALLOC_CTX *mem_ctx,
 	struct cldap_netlogon io;
 	struct netlogon_samlogon_response *reply;
 	NTSTATUS status;
-	struct in_addr addr;
-	char addrstr[INET_ADDRSTRLEN];
+	struct sockaddr_storage ss;
+	char addrstr[INET6_ADDRSTRLEN];
 	const char *dest_str;
 	int ret;
 	struct tsocket_address *dest_addr;
 
-	/* TODO: support ipv6 */
-
-	addr = interpret_addr2(server);
-	if (is_zero_ip_v4(addr)) {
-		DEBUG(2,("Failed to resolve[%s] into an address for cldap\n",
-			 server));
-		return false;
-	}
-	dest_str = inet_ntop(AF_INET, &addr,
-			     addrstr, sizeof(addrstr));
-	if (!dest_str) {
+	if (!interpret_string_addr(&ss, server, 0)) {
 		DEBUG(2,("Failed to resolve[%s] into an address for cldap\n",
-			 server));
+			server));
 		return false;
 	}
+	dest_str = print_sockaddr(addrstr, sizeof(addrstr), &ss);
 
-	ret = tsocket_address_inet_from_strings(mem_ctx, "ipv4",
+	ret = tsocket_address_inet_from_strings(mem_ctx, "ip",
 						dest_str, LDAP_PORT,
 						&dest_addr);
 	if (ret != 0) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list