summaryrefslogtreecommitdiff
path: root/source3/utils/net_ads_cldap.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils/net_ads_cldap.c')
-rw-r--r--source3/utils/net_ads_cldap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/utils/net_ads_cldap.c b/source3/utils/net_ads_cldap.c
index 1903172cf7..f3c6c5ff4d 100644
--- a/source3/utils/net_ads_cldap.c
+++ b/source3/utils/net_ads_cldap.c
@@ -280,8 +280,9 @@ int ads_cldap_netlogon(ADS_STRUCT *ads)
int sock;
int ret;
struct cldap_netlogon_reply reply;
+ const char *target = opt_host ? opt_host : inet_ntoa(ads->ldap_ip);
- sock = open_udp_socket(inet_ntoa(ads->ldap_ip), ads->ldap_port);
+ sock = open_udp_socket(target, ads->ldap_port);
if (sock == -1) {
d_printf("Failed to open udp socket to %s:%u\n",
inet_ntoa(ads->ldap_ip),