aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sctp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-12-15 16:39:27 -0800
committerGuy Harris <guy@alum.mit.edu>2015-12-16 00:45:18 +0000
commit68ca26ec75fb9cccbb64a859cafa1fb2c3d0cce7 (patch)
tree07bb373310d8557854a8006fa9856360c2a87211 /epan/dissectors/packet-sctp.c
parent396c92a89c36d867a1f588883d0ed76d5d0d5779 (diff)
Don't report an error for a non-multiple-of-4 chunk length.
To quote RFC 4960: Chunk Length: 16 bits (unsigned integer) This value represents the size of the chunk in bytes, including the Chunk Type, Chunk Flags, Chunk Length, and Chunk Value fields. Therefore, if the Chunk Value field is zero-length, the Length field will be set to 4. *The Chunk Length field does not count any chunk padding.* Chunks (including Type, Length, and Value fields) are padded out by the sender with all zero bytes to be a multiple of 4 bytes long. This padding MUST NOT be more than 3 bytes in total. The Chunk Length value does not include terminating padding of the chunk. However, it does include padding of any variable-length parameter except the last parameter in the chunk. The receiver MUST ignore the padding. Note: A robust implementation should accept the chunk whether or not the final padding has been included in the Chunk Length. so the the chunk is *not* required to include the length of the final padding in the chunk, although any padding *between* variable-length parameters in the chunk must be included in the length (obviously, as it's part of the chunk data). Change-Id: I99d64fdd907c41229aa9ad10a230fff4bcdfa5f4 Reviewed-on: https://code.wireshark.org/review/12664 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-sctp.c')
-rw-r--r--epan/dissectors/packet-sctp.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c
index 293760c100..bd8afaec73 100644
--- a/epan/dissectors/packet-sctp.c
+++ b/epan/dissectors/packet-sctp.c
@@ -4320,8 +4320,6 @@ dissect_sctp_chunk(tvbuff_t *chunk_tvb,
chunk_tree = proto_tree_add_subtree_format(sctp_tree, chunk_tvb, CHUNK_HEADER_OFFSET, reported_length,
ett_sctp_chunk, &chunk_item, "%s chunk",
val_to_str_const(type, chunk_type_values, "RESERVED"));
- if (reported_length % 4)
- expert_add_info_format(pinfo, chunk_item, &ei_sctp_chunk_length_bad, "Chunk length is not padded to a multiple of 4 bytes (length=%d).", reported_length);
if (tree) {
/* then insert the chunk header components into the protocol tree */