struct outstanding_packet_lookup *outstanding_packet_list;
};
-static void store_sequence_for_reply(struct outstanding_packet_lookup **list,
+static BOOL store_sequence_for_reply(struct outstanding_packet_lookup **list,
uint16 mid, uint32 reply_seq_num)
{
struct outstanding_packet_lookup *t;
+ /* Ensure we only add a mid once. */
+ for (t = *list; t; t = t->next) {
+ if (t->mid == mid) {
+ return False;
+ }
+ }
+
t = smb_xmalloc(sizeof(*t));
ZERO_STRUCTP(t);
DLIST_ADD(*list, t);
DEBUG(10,("store_sequence_for_reply: stored seq = %u mid = %u\n",
(unsigned int)reply_seq_num, (unsigned int)mid ));
+ return True;
}
static BOOL get_sequence_for_reply(struct outstanding_packet_lookup **list,
if (!good) {
- DEBUG(0, ("srv_check_incoming_message: BAD SIG: seq %u wanted SMB signature of\n",
- (unsigned int)saved_seq));
- dump_data(5, (const char *)calc_md5_mac, 8);
-
- DEBUG(0, ("srv_check_incoming_message: BAD SIG: seq %u got SMB signature of\n",
+ if (saved_seq) {
+ DEBUG(0, ("srv_check_incoming_message: BAD SIG: seq %u wanted SMB signature of\n",
(unsigned int)saved_seq));
- dump_data(5, (const char *)server_sent_mac, 8);
+ dump_data(5, (const char *)calc_md5_mac, 8);
+ DEBUG(0, ("srv_check_incoming_message: BAD SIG: seq %u got SMB signature of\n",
+ (unsigned int)reply_seq_number));
+ dump_data(5, (const char *)server_sent_mac, 8);
+ }
+
#if 1 /* JRATEST */
{
int i;
if (!data)
return;
- store_sequence_for_reply(&data->outstanding_packet_list,
- mid, data->send_seq_num);
- data->send_seq_num++;
+ /*
+ * Ensure we only store this mid reply once...
+ */
+
+ if (store_sequence_for_reply(&data->outstanding_packet_list, mid, data->send_seq_num)) {
+ data->send_seq_num++;
+ }
}
/***********************************************************
*/
if (global_client_caps & CAP_LEVEL_II_OPLOCKS) {
+ BOOL sign_state;
+
/*
* If we are sending an oplock break due to an SMB sent
* by our own client we ensure that we wait at leat
wait_before_sending_break(local_request);
/* Prepare the SMBlockingX message. */
-
prepare_break_message( outbuf, fsp, False);
+
+ /* Save the server smb signing state. */
+ sign_state = srv_oplock_set_signing(False);
+
if (!send_smb(smbd_server_fd(), outbuf))
exit_server("oplock_break_level2: send_smb failed.");
+
+ /* Restore the sign state to what it was. */
+ srv_oplock_set_signing(sign_state);
}
/*