diff options
author | Michael Tüxen <tuexen@fh-muenster.de> | 2012-11-29 18:09:51 +0000 |
---|---|---|
committer | Michael Tüxen <tuexen@fh-muenster.de> | 2012-11-29 18:09:51 +0000 |
commit | 749e52d996d78f40f6bf25c00e835719d16ce995 (patch) | |
tree | 9308e84a15255fd4292b2cc6e97e8203a92fa960 /epan/dissectors/packet-sctp.c | |
parent | 6f3c7f1f99f5114c8460985abd82784cac5ca2e3 (diff) |
The padding of the last parameter is not included in the length of the chunk
as described in RFC 4960, section 3.2.
svn path=/trunk/; revision=46290
Diffstat (limited to 'epan/dissectors/packet-sctp.c')
-rw-r--r-- | epan/dissectors/packet-sctp.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c index 4d9112d959..79249a8d44 100644 --- a/epan/dissectors/packet-sctp.c +++ b/epan/dissectors/packet-sctp.c @@ -1472,10 +1472,17 @@ dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, parameter_item = proto_tree_add_text(chunk_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_reported_length(parameter_tvb), "%s parameter", val_to_str_const(type, parameter_identifier_values, "Unknown")); parameter_tree = proto_item_add_subtree(parameter_item, ett_sctp_chunk_parameter); - if (!final_parameter && (reported_length % 4)) { - expert_add_info_format(pinfo, parameter_item, PI_MALFORMED, PI_ERROR, - "Parameter length is not padded to a multiple of 4 bytes (length=%d)", - reported_length); + if (final_parameter) { + if (padding_length > 0) { + expert_add_info_format(pinfo, parameter_item, PI_MALFORMED, PI_ERROR, + "The padding of this final parameter should be the padding of the chunk."); + } + } else { + if (reported_length % 4) { + expert_add_info_format(pinfo, parameter_item, PI_MALFORMED, PI_ERROR, + "Parameter length is not padded to a multiple of 4 bytes (length=%d)", + reported_length); + } } if (!(chunk_tree || (dissecting_init_init_ack_chunk && (type == IPV4ADDRESS_PARAMETER_ID || type == IPV6ADDRESS_PARAMETER_ID)))) |