summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-01-05 14:13:00 +0100
committerVolker Lendecke <vl@samba.org>2011-01-07 13:28:07 +0100
commit5f4ff3bfbd0a48787b8b57c60cc4c6cdcec036a1 (patch)
tree64e9bc06ec118b4e9dbc22316901ddc2e8fd8a87 /source3/winbindd
parentb4041b59b2977b821f1f786e42c9bfac9763d7ea (diff)
downloadsamba-5f4ff3bfbd0a48787b8b57c60cc4c6cdcec036a1.tar.gz
samba-5f4ff3bfbd0a48787b8b57c60cc4c6cdcec036a1.tar.bz2
samba-5f4ff3bfbd0a48787b8b57c60cc4c6cdcec036a1.zip
s3: Use the new nbt_getdc in winbindd_cm
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/winbindd_cm.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 6ec6861ea2..aa10ae3b72 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1107,8 +1107,8 @@ static bool dcip_to_name(TALLOC_CTX *mem_ctx,
{
struct ip_service ip_list;
uint32_t nt_version = NETLOGON_NT_VERSION_1;
- int dgm_id;
- uint16_t val;
+ NTSTATUS status;
+ const char *dc_name;
ip_list.ss = *pss;
ip_list.port = 0;
@@ -1173,27 +1173,13 @@ static bool dcip_to_name(TALLOC_CTX *mem_ctx,
}
#endif
- /* try GETDC requests next */
- generate_random_buffer((uint8_t *)&val, 2);
- dgm_id = val;
-
- if (send_getdc_request(winbind_messaging_context(),
- pss, domain->name, &domain->sid,
- nt_version, dgm_id)) {
- const char *dc_name = NULL;
- int i;
- smb_msleep(100);
- for (i=0; i<5; i++) {
- if (receive_getdc_response(mem_ctx, pss, domain->name,
- dgm_id,
- &nt_version,
- &dc_name, NULL)) {
- fstrcpy(name, dc_name);
- namecache_store(name, 0x20, 1, &ip_list);
- return True;
- }
- smb_msleep(500);
- }
+ status = nbt_getdc(winbind_messaging_context(), pss, domain->name,
+ &domain->sid, nt_version, mem_ctx, &nt_version,
+ &dc_name, NULL);
+ if (NT_STATUS_IS_OK(status)) {
+ fstrcpy(name, dc_name);
+ namecache_store(name, 0x20, 1, &ip_list);
+ return True;
}
/* try node status request */