[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-352-g4b47052

Jeremy Allison jra at samba.org
Wed Nov 21 18:11:19 GMT 2007


The branch, v3-2-test has been updated
       via  4b47052694285a1d1d313dfd61bd17011d62948d (commit)
      from  30c9e3557bf4ca0b85e15bd7cc883391aec42f1f (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 4b47052694285a1d1d313dfd61bd17011d62948d
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Nov 21 10:10:52 2007 -0800

    Add set_sockaddr_port function for winbindd.
    Jeremy.

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

Summary of changes:
 source/lib/util_sock.c        |   13 +++++++++++++
 source/winbindd/winbindd_cm.c |    2 ++
 2 files changed, 15 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/util_sock.c b/source/lib/util_sock.c
index a59b1d5..f1a6d82 100644
--- a/source/lib/util_sock.c
+++ b/source/lib/util_sock.c
@@ -627,6 +627,19 @@ static int get_socket_port(int fd)
 }
 #endif
 
+void set_sockaddr_port(struct sockaddr_storage *psa, uint16 port)
+{
+#if defined(HAVE_IPV6)
+	if (psa->ss_family == AF_INET6) {
+		((struct sockaddr_in6 *)psa)->sin6_port = htons(port);
+	}
+#else
+	if (psa->ss_family == AF_INET) {
+		((struct sockaddr_in *)psa)->sin_port = htons(port);
+	}
+#endif
+}
+
 const char *client_name(int fd)
 {
 	return get_peer_name(fd,false);
diff --git a/source/winbindd/winbindd_cm.c b/source/winbindd/winbindd_cm.c
index 4c9ae03..f8e76b0 100644
--- a/source/winbindd/winbindd_cm.c
+++ b/source/winbindd/winbindd_cm.c
@@ -923,6 +923,8 @@ static bool add_sockaddr_to_array(TALLOC_CTX *mem_ctx,
 	}
 
 	(*addrs)[*num] = *pss;
+	set_sockaddr_port(&(*addrs)[*num], port);
+
 	*num += 1;
 	return True;
 }


-- 
Samba Shared Repository


More information about the samba-cvs mailing list