summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-21 20:38:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:05 -0500
commita09f8c305256b94b078f7d293fe1fc9b56d28810 (patch)
tree54d31ad4e235d5fc992a8c765af36caa59f7a394
parent6b5f8665b0de1ebf6d51e81e3d9687dceb93c015 (diff)
downloadsamba-a09f8c305256b94b078f7d293fe1fc9b56d28810.tar.gz
samba-a09f8c305256b94b078f7d293fe1fc9b56d28810.tar.bz2
samba-a09f8c305256b94b078f7d293fe1fc9b56d28810.zip
r4909: fixed name_trn_id generation (thanks to metze for spotting the bug!)
(This used to be commit 9d2d16ce5fd57cad01ddaf1112beed916cc2088d)
-rw-r--r--source4/libcli/nbt/nbtsocket.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/libcli/nbt/nbtsocket.c b/source4/libcli/nbt/nbtsocket.c
index 8b212fb555..b0248b6de0 100644
--- a/source4/libcli/nbt/nbtsocket.c
+++ b/source4/libcli/nbt/nbtsocket.c
@@ -345,10 +345,12 @@ struct nbt_name_request *nbt_name_request_send(struct nbt_name_socket *nbtsock,
id = idr_get_new_above(req->nbtsock->idr, req,
req->request->name_trn_id, UINT16_MAX);
if (id == -1) {
- id = idr_get_new_above(req->nbtsock->idr, req, 1+(generate_random()%(UINT16_MAX/2)),
+ id = idr_get_new_above(req->nbtsock->idr, req,
+ 1+(generate_random()%(UINT16_MAX/2)),
UINT16_MAX);
}
if (id == -1) goto failed;
+ req->request->name_trn_id = id;
te.next_event = timeout;
te.handler = nbt_name_socket_timeout;