svn commit: samba r3277 - in branches/SAMBA_4_0/source/librpc/rpc: .

tridge at samba.org tridge at samba.org
Wed Oct 27 01:30:59 GMT 2004


Author: tridge
Date: 2004-10-27 01:30:59 +0000 (Wed, 27 Oct 2004)
New Revision: 3277

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/librpc/rpc&rev=3277&nolog=1

Log:
don't use the non-portable getaddrinfo() function, instead use
interpret_addr() and if someone wants to add support to that function
for ipv6 then they are welcome to.

Modified:
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c	2004-10-27 01:11:44 UTC (rev 3276)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c	2004-10-27 01:30:59 UTC (rev 3277)
@@ -440,25 +440,10 @@
 		return NT_STATUS_OK;
 
 	case EPM_PROTOCOL_IP:
-		floor->rhs.ip.address = 0;
-
-		/* Only try to put in a IPv4 address. Windows 2003 just returns 
-		 * 0.0.0.0 for IPv6 addresses */
 		if (strlen(data) > 0) {
-		    struct addrinfo hints, *res;
-
- 		  	memset(&hints, 0, sizeof(struct addrinfo));
-
-			hints.ai_family = AF_INET;
-			hints.ai_protocol = PF_INET;
-
-			if (getaddrinfo(data, NULL, &hints, &res) < 0) {
-				return NT_STATUS_BAD_NETWORK_NAME;
-			}
-
-			floor->rhs.ip.address = ntohl(((struct sockaddr_in *)res->ai_addr)->sin_addr.s_addr);
-
-			freeaddrinfo(res);
+			floor->rhs.ip.address = interpret_addr(data);
+		} else {
+			floor->rhs.ip.address = 0;
 		}
 		return NT_STATUS_OK;
 



More information about the samba-cvs mailing list