diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2006-03-13 10:29:00 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2006-03-13 10:29:00 +0000 |
commit | edcaaee164ad486bc1302d11f08a021d0301e8b5 (patch) | |
tree | e8b6570c770b12e2f948a637a9a15a2c37e04896 /epan/dissectors/packet-frame.c | |
parent | 11c3d3d90dead7cbc4439cf6e70ac89182e61d90 (diff) |
SCSI is fairly unique among the ethereal protocols in that it is sometimes normal for a PDU we receive back froma device to be truncated.
(report luns with allocation length 8 for example)
Therefore it is a bit wrong to mark these packets as [malformed packets]
Since they are truncated by scsi and this is NOTY an error condition.
Add a new exception type : ScsiBoundsError
If this exception is caught by packet-frame, then print an appropriate message
instead of [malformed packet]
For SCSI, add helper macros TRY_SCSI_SHORT_PACKET and END_...
If the packet was not short in the normal sense (snaplen < packetlen) then intercept the exception for BoundsError and rethrow it as ScsiBoundsError instead.
svn path=/trunk/; revision=17611
Diffstat (limited to 'epan/dissectors/packet-frame.c')
-rw-r--r-- | epan/dissectors/packet-frame.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c index 3929956a4c..28d869ceeb 100644 --- a/epan/dissectors/packet-frame.c +++ b/epan/dissectors/packet-frame.c @@ -333,6 +333,17 @@ show_exception(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, switch (exception) { + case ScsiBoundsError: + if (check_col(pinfo->cinfo, COL_INFO)) + col_append_str(pinfo->cinfo, COL_INFO, "[SCSI transfer limited due to allocation_length too small]"); + /*item =*/ proto_tree_add_protocol_format(tree, proto_short, tvb, 0, 0, + "SCSI transfer limited due to allocation_length too small: %s truncated]", pinfo->current_proto); + /* Don't record ScsiBoundsError exceptions as expert events - they merely + * reflect a normal SCSI condition. + * (any case where it's caused by something else is a bug). */ + /* expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR, "Packet size limited");*/ + break; + case BoundsError: if (check_col(pinfo->cinfo, COL_INFO)) col_append_str(pinfo->cinfo, COL_INFO, "[Packet size limited during capture]"); |