diff options
author | Jeremy Allison <jra@samba.org> | 2007-10-24 14:16:54 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-10-24 14:16:54 -0700 |
commit | f88b7a076be74a29a3bf876b4e2705f4a1ecf42b (patch) | |
tree | 2d5167540fcbe1ad245fce697924b18216b2d142 /source3/utils/netlookup.c | |
parent | e01cbcb28e63abb0f681a5a168fc2445744eec93 (diff) | |
download | samba-f88b7a076be74a29a3bf876b4e2705f4a1ecf42b.tar.gz samba-f88b7a076be74a29a3bf876b4e2705f4a1ecf42b.tar.xz 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.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/utils/netlookup.c b/source3/utils/netlookup.c index 315a89d5a8c..90f99e4c8b0 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, |