summaryrefslogtreecommitdiff
path: root/source3/utils/netlookup.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-10-24 14:16:54 -0700
committerJeremy Allison <jra@samba.org>2007-10-24 14:16:54 -0700
commitf88b7a076be74a29a3bf876b4e2705f4a1ecf42b (patch)
tree2d5167540fcbe1ad245fce697924b18216b2d142 /source3/utils/netlookup.c
parente01cbcb28e63abb0f681a5a168fc2445744eec93 (diff)
downloadsamba-f88b7a076be74a29a3bf876b4e2705f4a1ecf42b.tar.gz
samba-f88b7a076be74a29a3bf876b4e2705f4a1ecf42b.tar.bz2
samba-f88b7a076be74a29a3bf876b4e2705f4a1ecf42b.zip
This is a large patch (sorry). Migrate from struct in_addr
to struct sockaddr_storage in most places that matter (ie. not the nmbd and NetBIOS lookups). This passes make test on an IPv4 box, but I'll have to do more work/testing on IPv6 enabled boxes. This should now give us a framework for testing and finishing the IPv6 migration. It's at the state where someone with a working IPv6 setup should (theorecically) be able to type : smbclient //ipv6-address/share and have it work. Jeremy. (This used to be commit 98e154c3125d5732c37a72d74b0eb5cd7b6155fd)
Diffstat (limited to 'source3/utils/netlookup.c')
-rw-r--r--source3/utils/netlookup.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/utils/netlookup.c b/source3/utils/netlookup.c
index 315a89d5a8..90f99e4c8b 100644
--- a/source3/utils/netlookup.c
+++ b/source3/utils/netlookup.c
@@ -56,11 +56,15 @@ static int cs_destructor(struct con_struct *p)
static struct con_struct *create_cs(TALLOC_CTX *ctx, NTSTATUS *perr)
{
NTSTATUS nt_status;
- struct in_addr loopback_ip;
+ struct sockaddr_storage loopback_ss;
- loopback_ip.s_addr = htonl(INADDR_LOOPBACK);
*perr = NT_STATUS_OK;
+ if (!interpret_string_addr(&loopback_ss, "127.0.0.1", AI_NUMERICHOST)) {
+ *perr = NT_STATUS_INVALID_PARAMETER;
+ return NULL;
+ }
+
if (cs) {
if (cs->failed_connect) {
*perr = cs->err;
@@ -90,7 +94,7 @@ static struct con_struct *create_cs(TALLOC_CTX *ctx, NTSTATUS *perr)
#endif
nt_status = cli_full_connection(&cs->cli, global_myname(), global_myname(),
- &loopback_ip, 0,
+ &loopback_ss, 0,
"IPC$", "IPC",
#if 0
opt_user_name,