diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2012-11-27 23:13:56 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2012-11-27 23:13:56 +0000 |
commit | 4da68e75e011479d675dbfbdb3b48e7a34699912 (patch) | |
tree | 0c37be9b5b1e54d89ad1c5a51738cab4da0c4bf3 /epan/dissectors/packet-sctp.c | |
parent | 38b58bd671daed39eb5817ed302a7bc50763036f (diff) |
Warn about non-final parameters that aren't padded correctly. I'm not sure
that final parameters *with* padding is all that important (maybe it should
be there but not PI_ERROR?).
svn path=/trunk/; revision=46239
Diffstat (limited to 'epan/dissectors/packet-sctp.c')
-rw-r--r-- | epan/dissectors/packet-sctp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c index 98af97bec0..cfd9f8d141 100644 --- a/epan/dissectors/packet-sctp.c +++ b/epan/dissectors/packet-sctp.c @@ -1472,10 +1472,12 @@ 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 && (padding_length > 0)) { + if (!final_parameter && (reported_length % 4)) { expert_add_info_format(pinfo, parameter_item, PI_MALFORMED, PI_ERROR, - "The padding of this final parameter should be the padding of the chunk."); + "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)))) return; |