summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/clientutil.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source3/client/clientutil.c b/source3/client/clientutil.c
index 4064dbecd7..bf49c6b342 100644
--- a/source3/client/clientutil.c
+++ b/source3/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);
}