summaryrefslogtreecommitdiff
path: root/source/client/clientutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/client/clientutil.c')
-rw-r--r--source/client/clientutil.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/client/clientutil.c b/source/client/clientutil.c
index 4064dbecd78..bf49c6b342b 100644
--- a/source/client/clientutil.c
+++ b/source/client/clientutil.c
@@ -891,15 +891,18 @@ BOOL cli_open_sockets(int port )
{
#ifdef USENMB
/* Try and resolve the name with the netbios server */
- int bcast;
+ int bcast, count;
+ struct in_addr *ip_list;
if ((bcast = open_socket_in(SOCK_DGRAM, 0, 3,
interpret_addr(lp_socket_address()))) != -1) {
set_socket_options(bcast, "SO_BROADCAST");
- if (name_query(bcast, host, name_type, True, True, *iface_bcast(dest_ip),
- &dest_ip,0)) {
- failed = False;
+ if ((ip_list = name_query(bcast, host, name_type, True, True, *iface_bcast(dest_ip),
+ &count,0)) {
+ dest_ip = ip_list[0];
+ free(ip_list);
+ failed = False;
}
close (bcast);
}