summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_wins.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nsswitch/winbindd_wins.c')
-rw-r--r--source3/nsswitch/winbindd_wins.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/source3/nsswitch/winbindd_wins.c b/source3/nsswitch/winbindd_wins.c
index a8b4566ba0..75d04349e6 100644
--- a/source3/nsswitch/winbindd_wins.c
+++ b/source3/nsswitch/winbindd_wins.c
@@ -92,20 +92,14 @@ static struct in_addr *lookup_byname_backend(const char *name, int *count)
*count = 0;
- fd = wins_lookup_open_socket_in();
- if (fd == -1)
- return NULL;
-
- p = wins_srv_ip();
- if( !is_zero_ip(p) ) {
- ret = name_query(fd,name,0x20,False,True, p, count, &flags);
- goto out;
+ /* always try with wins first */
+ if (resolve_wins(name,0x20,&ret,count)) {
+ return ret;
}
- if (lp_wins_support()) {
- /* we are our own WINS server */
- ret = name_query(fd,name,0x20,False,True, *interpret_addr2("127.0.0.1"), count, &flags);
- goto out;
+ fd = wins_lookup_open_socket_in();
+ if (fd == -1) {
+ return NULL;
}
/* uggh, we have to broadcast to each interface in turn */
@@ -113,12 +107,11 @@ static struct in_addr *lookup_byname_backend(const char *name, int *count)
j >= 0;
j--) {
struct in_addr *bcast = iface_n_bcast(j);
- ret = name_query(fd,name,0x20,True,True,*bcast,count, &flags);
+ ret = name_query(fd,name,0x20,True,True,*bcast,count, &flags, NULL);
if (ret) break;
}
out:
-
close(fd);
return ret;
}