summaryrefslogtreecommitdiff
path: root/source3/smbd/globals.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-06-27 15:33:43 +0200
committerStefan Metzmacher <metze@samba.org>2012-06-29 00:14:54 +0200
commitee8ae459aea6879377b5510851a6dc673cf72aad (patch)
tree960cd37312c85a9dc99603a302c7f949df2c76aa /source3/smbd/globals.h
parent4fe41c0bb14f6ae7e52aa7f180e66c7695eb6fa0 (diff)
downloadsamba-ee8ae459aea6879377b5510851a6dc673cf72aad.tar.gz
samba-ee8ae459aea6879377b5510851a6dc673cf72aad.tar.bz2
samba-ee8ae459aea6879377b5510851a6dc673cf72aad.zip
s3:smb2_server: make sure we don't grant more credits than we allow
If the client hasn't consumed the lowest seqnum, but the distance between lowest and highest seqnum has reached max credits. In that case we should stop granting credits. metze
Diffstat (limited to 'source3/smbd/globals.h')
-rw-r--r--source3/smbd/globals.h43
1 files changed, 39 insertions, 4 deletions
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 4cbafe47ca..9512d05735 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -641,14 +641,49 @@ struct smbd_server_connection {
bool blocking_lock_unlock_state;
} locks;
struct smbd_smb2_request *requests;
+ /*
+ * seqnum_low is the lowest sequence number
+ * we will accept.
+ */
uint64_t seqnum_low;
- uint32_t credits_granted;
- uint32_t max_credits;
+ /*
+ * seqnum_range is the range of credits we have
+ * granted from the sequence windows starting
+ * at seqnum_low.
+ *
+ * This gets incremented when new credits are
+ * granted and gets decremented when the
+ * lowest sequence number is consumed
+ * (when seqnum_low gets incremented).
+ */
+ uint16_t seqnum_range;
+ /*
+ * credits_grantedThe number of credits we have currently granted
+ * to the client.
+ *
+ * This gets incremented when new credits are
+ * granted and gets decremented when any credit
+ * is comsumed.
+ *
+ * Note: the decrementing is different compared
+ * to seqnum_range.
+ */
+ uint16_t credits_granted;
+ /*
+ * The maximum number of credits we will ever
+ * grant to the client.
+ *
+ * This is the "server max credits" parameter.
+ */
+ uint16_t max_credits;
+ /*
+ * a bitmap of size max_credits
+ */
+ struct bitmap *credits_bitmap;
+ bool supports_multicredit;
uint32_t max_trans;
uint32_t max_read;
uint32_t max_write;
- bool supports_multicredit;
- struct bitmap *credits_bitmap;
bool compound_related_in_progress;
} smb2;