bool receive_getdc_response(TALLOC_CTX *mem_ctx,
struct sockaddr_storage *dc_ss,
const char *domain_name,
- const char **dc_name)
+ const char **dc_name,
+ struct nbt_ntlogon_packet **reply)
{
struct packet_struct *packet;
const char *my_mailslot = NULL;
if (**dc_name == '\\') *dc_name += 1;
if (**dc_name == '\\') *dc_name += 1;
+ if (reply) {
+ *reply = talloc_memdup(mem_ctx, &r,
+ sizeof(struct nbt_ntlogon_packet));
+ if (!*reply) {
+ return false;
+ }
+ }
+
DEBUG(10, ("GetDC gave name %s for domain %s\n",
*dc_name, returned_domain));
const char *dc_name = NULL;
fstring tmp_dc_name;
struct messaging_context *msg_ctx = msg_context(mem_ctx);
+ struct nbt_ntlogon_packet *reply = NULL;
if (flags & DS_PDC_REQUIRED) {
name_type = NBT_NAME_PDC;
if (receive_getdc_response(mem_ctx,
&dclist[i].ss,
domain_name,
- &dc_name)) {
+ &dc_name,
+ &reply)) {
namecache_store(dc_name, NBT_NAME_SERVER, 1, &ip_list);
dc_hostname = dc_name;
dc_domain_name = talloc_strdup_upper(mem_ctx, domain_name);
int i;
smb_msleep(100);
for (i=0; i<5; i++) {
- if (receive_getdc_response(mem_ctx, pss, domain->name, &dc_name)) {
+ if (receive_getdc_response(mem_ctx, pss, domain->name,
+ &dc_name, NULL)) {
fstrcpy(name, dc_name);
namecache_store(name, 0x20, 1, &ip_list);
return True;