s4:libcli/smb2: calculate the correct credit charge in smb2_notify_send()
authorStefan Metzmacher <metze@samba.org>
Tue, 8 Jan 2019 09:10:49 +0000 (10:10 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 28 Mar 2019 23:09:37 +0000 (23:09 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13863

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/libcli/smb2/notify.c

index ef7341cae8a86e2e3aaae7c56ade67f883713e0c..6786a70b6b57a7bffcecf121b35e741f4f74493f 100644 (file)
@@ -44,6 +44,8 @@ struct smb2_request *smb2_notify_send(struct smb2_tree *tree, struct smb2_notify
        SIVAL(req->out.body, 0x18, io->in.completion_filter);
        SIVAL(req->out.body, 0x1C, io->in.unknown);
 
+       req->credit_charge = (MAX(io->in.buffer_size, 1) - 1)/ 65536 + 1;
+
        old_timeout = req->transport->options.request_timeout;
        req->transport->options.request_timeout = 0;
        smb2_transport_send(req);