From 9d3cce7c68723954bf3e97ba5681aa60c31eb835 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 15 Oct 1997 09:15:45 +0000 Subject: fixed the freeze on logout bug. The fix has several parts: 1) add a new parameter to queue_netbios_packet(), the "reply_id", this is the id that should be used when sending a further response to the packet (such as a response after we get back a reply to a name query after senidnga WACK). reply_id is 0 (meaning unused) in most cases. 2) fix the id used in the reply in add_name_respond() from response_name_query_register() 3) remember to remove the response record at the end of response_name_query_register() 4) get the right IP address (it was 0.0.0.0) in response_name_query_register() 5) add a new field reply_id to struct response_record (This used to be commit e1e86c1a160c8302004ea58e4f0f5874dd179dae) --- source3/nameservresp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source3/nameservresp.c') diff --git a/source3/nameservresp.c b/source3/nameservresp.c index a88481d06b..8de90113fb 100644 --- a/source3/nameservresp.c +++ b/source3/nameservresp.c @@ -176,7 +176,7 @@ static void response_server_check(struct nmb_name *ans_name, queue_netbios_packet(d,ClientNMB,NMB_STATUS, cmd, ans_name->name, ans_name->name_type, 0,0,0,n->my_name,NULL, - False,False,send_ip,n->reply_to_ip); + False,False,send_ip,n->reply_to_ip, 0); } @@ -362,9 +362,11 @@ static void response_name_query_register(struct nmb_packet *nmb, } /* register the old or the new owners' ip */ - add_name_respond(d, n->fd, d->myip, n->response_id,&n->name,n->nb_flags, + add_name_respond(d, n->fd, d->myip, n->reply_id,&n->name,n->nb_flags, GET_TTL(0), register_ip, new_owner, n->reply_to_ip); + + remove_response_record(d,n); /* remove the response record */ } @@ -829,8 +831,8 @@ void response_netbios_packet(struct packet_struct *p) } ans_name = &nmb->answers->rr_name; - DEBUG(3,("response for %s from %s (bcast=%s)\n", - namestr(ans_name), inet_ntoa(p->ip), BOOLSTR(bcast))); + DEBUG(3,("response for %s from %s(%d) (bcast=%s)\n", + namestr(ans_name), inet_ntoa(p->ip), p->port, BOOLSTR(bcast))); debug_rr_type(nmb->answers->rr_type); -- cgit