summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-06-25 23:38:32 +0200
committerStefan Metzmacher <metze@samba.org>2012-06-29 00:14:52 +0200
commitd1ee774ed0b4b3882b4b85da16d9bb9c082a0c49 (patch)
tree1fda853ab85d8cc99cedcb4cac82630cc97b18af /source3/smbd
parent925994e42eba5b72ce605b68e8980adc1b5ecd83 (diff)
downloadsamba-d1ee774ed0b4b3882b4b85da16d9bb9c082a0c49.tar.gz
samba-d1ee774ed0b4b3882b4b85da16d9bb9c082a0c49.tar.bz2
samba-d1ee774ed0b4b3882b4b85da16d9bb9c082a0c49.zip
s3:smb2_server: remove unused and confusing DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR
metze
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/smb2_server.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index e2db9b0f07..0af1303f0f 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -112,7 +112,7 @@ static NTSTATUS smbd_initialize_smb2(struct smbd_server_connection *sconn)
sconn->smb2.credits_granted = 1;
sconn->smb2.max_credits = lp_smb2_max_credits();
sconn->smb2.credits_bitmap = bitmap_talloc(sconn,
- DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR*sconn->smb2.max_credits);
+ sconn->smb2.max_credits);
if (sconn->smb2.credits_bitmap == NULL) {
return NT_STATUS_NO_MEMORY;
}
@@ -310,7 +310,7 @@ static bool smb2_validate_message_id(struct smbd_server_connection *sconn,
if (message_id < sconn->smb2.seqnum_low ||
message_id > (sconn->smb2.seqnum_low +
- (sconn->smb2.max_credits * DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR))) {
+ (sconn->smb2.max_credits))) {
DEBUG(0,("smb2_validate_message_id: bad message_id "
"%llu (low = %llu, max = %lu)\n",
(unsigned long long)message_id,
@@ -355,9 +355,7 @@ static bool smb2_validate_message_id(struct smbd_server_connection *sconn,
DEBUG(11, ("Iterating mid %llu\n", (unsigned long long) i));
/* Mark the message_ids as seen in the bitmap. */
- bitmap_offset = (unsigned int)(i %
- (uint64_t)(sconn->smb2.max_credits *
- DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR));
+ bitmap_offset = i % sconn->smb2.max_credits;
if (bitmap_query(credits_bm, bitmap_offset)) {
DEBUG(0,("smb2_validate_message_id: duplicate "
"message_id %llu (bm offset %u)\n",
@@ -377,8 +375,7 @@ static bool smb2_validate_message_id(struct smbd_server_connection *sconn,
bitmap_clear(credits_bm, bitmap_offset);
sconn->smb2.seqnum_low += 1;
bitmap_offset = (bitmap_offset + 1) %
- (sconn->smb2.max_credits *
- DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR);
+ sconn->smb2.max_credits;
}
}
}