r6320: some minor netlogon datagram fixes - NT4 can now join a Samba4 domain without
[samba.git] / source / libcli / dgram / netlogon.c
index 138cc0d4844df06d44b3499a45364c00898eb5d8..a030ca73c28f20e0250f0792c9d5076c38c1fd0c 100644 (file)
@@ -70,6 +70,7 @@ NTSTATUS dgram_mailslot_netlogon_reply(struct nbt_dgram_socket *dgmsock,
        NTSTATUS status;
        DATA_BLOB blob;
        TALLOC_CTX *tmp_ctx = talloc_new(dgmsock);
        NTSTATUS status;
        DATA_BLOB blob;
        TALLOC_CTX *tmp_ctx = talloc_new(dgmsock);
+       struct nbt_name myname;
 
        status = ndr_push_struct_blob(&blob, tmp_ctx, reply, 
                                      (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_packet);
 
        status = ndr_push_struct_blob(&blob, tmp_ctx, reply, 
                                      (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_packet);
@@ -78,11 +79,15 @@ NTSTATUS dgram_mailslot_netlogon_reply(struct nbt_dgram_socket *dgmsock,
                return status;
        }
 
                return status;
        }
 
+       myname.name = lp_netbios_name();
+       myname.type = NBT_NAME_CLIENT;
+       myname.scope = NULL;
+
        status = dgram_mailslot_send(dgmsock, DGRAM_DIRECT_UNIQUE, 
                                     mailslot_name,
                                     &request->data.msg.source_name,
                                     request->source, request->src_port,
        status = dgram_mailslot_send(dgmsock, DGRAM_DIRECT_UNIQUE, 
                                     mailslot_name,
                                     &request->data.msg.source_name,
                                     request->source, request->src_port,
-                                    &request->data.msg.dest_name, &blob);
+                                    &myname, &blob);
        talloc_free(tmp_ctx);
        return status;
 }
        talloc_free(tmp_ctx);
        return status;
 }