1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

r4909: fixed name_trn_id generation (thanks to metze for spotting the bug!)

(This used to be commit 9d2d16ce5f)
This commit is contained in:
Andrew Tridgell 2005-01-21 20:38:33 +00:00 committed by Gerald (Jerry) Carter
parent 6b5f8665b0
commit a09f8c3052

View File

@ -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;