diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-01-29 04:44:40 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-01-29 04:44:40 +0000 |
commit | 995a967894938450ff8dd00f3a397ddd3b82f47c (patch) | |
tree | f46a8c6d1430adb7afedbb5c4e8be42bdf646687 /epan/dissectors | |
parent | 3d9c7d48ae267513aaf2f70069e8e676ad4aaab1 (diff) |
only add 4 bytes to the pdu length IFF header digest/crc32 is actually used.
svn path=/trunk/; revision=13193
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-iscsi.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c index 5a3d224387..6831c2803c 100644 --- a/epan/dissectors/packet-iscsi.c +++ b/epan/dissectors/packet-iscsi.c @@ -1,3 +1,11 @@ +/* TODO for the cases where one just can not autodetect whether header digest + is used or not we might need a new preference + HeaderDigest : + Automatic (default) + None + CRC32 +*/ + /* packet-iscsi.c * Routines for iSCSI dissection * Copyright 2001, Eurologic and Mark Burton <markb@ordern.com> @@ -1777,9 +1785,6 @@ dissect_iscsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean chec if((pduLen & 3) != 0) pduLen += 4 - (pduLen & 3); - if(digestsActive) { - pduLen += 4; - } if(digestsActive && data_segment_len > 0 && enableDataDigests) { if(dataDigestIsCRC32) @@ -1826,6 +1831,23 @@ dissect_iscsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean chec } + /* Add header digest length to pdulen */ + if(digestsActive){ + switch(iscsi_session->header_digest){ + case ISCSI_HEADER_DIGEST_CRC32: + pduLen += 4; + break; + case ISCSI_HEADER_DIGEST_NONE: + break; + case ISCSI_HEADER_DIGEST_AUTO: + /* oops we didnt know what digest is used yet */ + /* here we should use some default */ + break; + default: + g_assert_not_reached(); + } + } + /* * Desegmentation check. */ |