summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-06-03 15:49:55 +0200
committerVolker Lendecke <vl@samba.org>2011-06-12 17:07:47 +0200
commitebf04d79abdf0a15248a266162c8ec8906ce3c5f (patch)
treef4b3f8a9cf3510c75a96e225893201a4d849c7d6 /nsswitch
parenteb16915e283879aaf0797896fc9bd96b095ff550 (diff)
downloadsamba-ebf04d79abdf0a15248a266162c8ec8906ce3c5f.tar.gz
samba-ebf04d79abdf0a15248a266162c8ec8906ce3c5f.tar.bz2
samba-ebf04d79abdf0a15248a266162c8ec8906ce3c5f.zip
s3: Remove "struct ip_service" from resolve_wins
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/wins.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/nsswitch/wins.c b/nsswitch/wins.c
index 5c9ad2fb05..d63968b2bc 100644
--- a/nsswitch/wins.c
+++ b/nsswitch/wins.c
@@ -60,8 +60,9 @@ static void nss_wins_init(void)
static struct in_addr *lookup_byname_backend(const char *name, int *count)
{
TALLOC_CTX *frame = talloc_stackframe();
- struct ip_service *address = NULL;
+ struct sockaddr_storage *address = NULL;
struct in_addr *ret = NULL;
+ NTSTATUS status;
int j;
if (!initialised) {
@@ -71,21 +72,20 @@ static struct in_addr *lookup_byname_backend(const char *name, int *count)
*count = 0;
/* always try with wins first */
- if (NT_STATUS_IS_OK(resolve_wins(name,0x00,&address,count))) {
+ status = resolve_wins(name, 0x00, talloc_tos(),
+ &address, count);
+ if (NT_STATUS_IS_OK(status)) {
if ( (ret = SMB_MALLOC_P(struct in_addr)) == NULL ) {
- free( address );
TALLOC_FREE(frame);
return NULL;
}
- if (address[0].ss.ss_family != AF_INET) {
- free(address);
+ if (address[0].ss_family != AF_INET) {
free(ret);
TALLOC_FREE(frame);
return NULL;
}
- *ret = ((struct sockaddr_in *)(void *)&address[0].ss)
+ *ret = ((struct sockaddr_in *)(void *)address)
->sin_addr;
- free( address );
TALLOC_FREE(frame);
return ret;
}
@@ -95,7 +95,6 @@ static struct in_addr *lookup_byname_backend(const char *name, int *count)
const struct in_addr *bcast = iface_n_bcast_v4(j);
struct sockaddr_storage ss;
struct sockaddr_storage *pss;
- NTSTATUS status;
if (!bcast) {
continue;