winsserver: we need to ignore duplicated name register requests.
authorStefan Metzmacher <metze@sernet.de>
Fri, 11 Jan 2008 15:11:59 +0000 (16:11 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 19 Jan 2009 06:05:21 +0000 (07:05 +0100)
commitee8f481d9422dff239a871d363da879a5776f7d9
tree15f08fd1127e6f0f33025314204f1c42242d2d83
parentbae593bb118459c1b0d12d02e58ba6c89400aa97
winsserver: we need to ignore duplicated name register requests.

This fixes the following bug:

While we reply with a WACK response to a client.
Instead of waiting for the final reply some
windows client just resends the request using
the same name_trn_id in the nbt_name_packet.
We handled this as a new request and send a
WACK response (and the challenges) again.
Then the first request gets its final success
response, but the when we try to send the success
for the "second" request we notice that
the record was changed in between and we return
an error.

Windows 2003 (and I assume all other versions as well)
detect the packet is just a resent of a currently pending
request and ignores it.

So we now keep a list of all pending WINS name register
requests which result in a WACK response. On each incoming
name register request we search through the list to find
duplicate requests and ignore them. In theory we should
do that for all requests, but name register requests
are the only requests we response async and only
if we have to go via the WACK code path.

metze
(from samba4wins tree 382e7d384b70d03e9f81c7bb353afaed288d80f0)
source4/nbt_server/interfaces.c
source4/nbt_server/nbt_server.h
source4/nbt_server/wins/winsserver.c