diff options
author | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-06-15 00:16:06 +0000 |
---|---|---|
committer | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-06-15 00:16:06 +0000 |
commit | a458d6e1cfd4ac2f1e28201a924ba94a6352bbe8 (patch) | |
tree | 8a66c58b07bd8442765d9c8a40579fb0f2c84ba8 /packet-iscsi.c | |
parent | fa6a1966d58a5406770199c473eb595259ae8284 (diff) |
Let iSCSI/TCP keep track of where PDU bundaries are in the TCP stream.
This will reduce the chance of false-positives in detecting iscsi headers
inside a large data transfer. the dissector needs to become a bit more
stateful first.
NOP-Out commands will have a TransferTag of either -1 or a valid value if
a response is requested.
Assume opcode==NOP-Out (0) and TransferTag==0 is a non-iscsi header.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7887 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-iscsi.c')
-rw-r--r-- | packet-iscsi.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/packet-iscsi.c b/packet-iscsi.c index 588df39b2e..b060656a2f 100644 --- a/packet-iscsi.c +++ b/packet-iscsi.c @@ -2,7 +2,7 @@ * Routines for iSCSI dissection * Copyright 2001, Eurologic and Mark Burton <markb@ordern.com> * - * $Id: packet-iscsi.c,v 1.43 2003/01/28 23:56:39 guy Exp $ + * $Id: packet-iscsi.c,v 1.44 2003/06/15 00:16:06 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1567,6 +1567,15 @@ dissect_iscsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { opcode == ISCSI_OPCODE_SNACK_REQUEST || opcode == ISCSI_OPCODE_REJECT)) { badPdu = TRUE; + } else if(opcode==ISCSI_OPCODE_NOP_OUT) { + /* TransferTag for NOP-Out should either be -1 or + the tag value we want for a response. + Assume 0 means we are just inside a big all zero + datablock. + */ + if(tvb_get_ntohl(tvb, offset+20)==0){ + badPdu = TRUE; + } } } @@ -1632,6 +1641,21 @@ dissect_iscsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { } } + /* This is to help TCP keep track of PDU boundaries + and allows it to find PDUs that are not aligned to + the start of a TCP segments. + Since it also allows TCP to know what is in the middle + of a large PDU, it reduces the probability of a segment + in the middle of a large PDU transfer being misdissected as + a PDU. + */ + if(!pinfo->fd->flags.visited){ + if(pduLen>tvb_reported_length_remaining(tvb, offset)){ + pinfo->want_pdu_tracking=2; + pinfo->bytes_until_next_pdu=pduLen-tvb_reported_length_remaining(tvb, offset); + } + } + if(check_col(pinfo->cinfo, COL_INFO)) { if(iSCSIPdusDissected == 0) col_set_str(pinfo->cinfo, COL_INFO, ""); |