aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2016-04-19 16:44:14 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2016-04-19 16:28:35 +0000
commitc9c3162ef34886788221eab57012af7e67eca676 (patch)
tree5ba67807fae7b9b5ba756d9d7bc12d4b145ea146 /epan
parent0b824d41c206fecd77603b95f1f905efe183d524 (diff)
iWARP MPA: properly handle MPA PDU length with padding
Bug: 12348 Change-Id: I2ed5fcce34bbdb13329ca72012f92adb641f56c6 Reviewed-on: https://code.wireshark.org/review/15005 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-iwarp-mpa.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/dissectors/packet-iwarp-mpa.c b/epan/dissectors/packet-iwarp-mpa.c
index 2ac662757d..aa82e8cf17 100644
--- a/epan/dissectors/packet-iwarp-mpa.c
+++ b/epan/dissectors/packet-iwarp-mpa.c
@@ -714,12 +714,13 @@ dissect_mpa_fpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* that exactly one MPA FPDU is contained in one TCP segment and starts
* always either with a Marker or the ULPDU_LENGTH header field.
*/
+ pad_length = fpdu_pad_length(ulpdu_length);
exp_ulpdu_length = expected_ulpdu_length(state, tcpinfo, endpoint);
- if (!exp_ulpdu_length || exp_ulpdu_length != ulpdu_length) {
+ if (!exp_ulpdu_length || exp_ulpdu_length != (ulpdu_length + pad_length)) {
proto_tree_add_expert_format(tree, pinfo, &ei_mpa_bad_length, tvb, offset,
MPA_ULPDU_LENGTH_LEN,
"[ULPDU length [%u] field does not contain the expected length[%u]]",
- exp_ulpdu_length, ulpdu_length);
+ exp_ulpdu_length, ulpdu_length + pad_length);
}
mpa_item = proto_tree_add_item(tree, proto_iwarp_mpa, tvb, 0,
@@ -737,8 +738,6 @@ dissect_mpa_fpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
MPA_ULPDU_LENGTH_LEN, ulpdu_length, "%u bytes",
ulpdu_length);
- pad_length = fpdu_pad_length(ulpdu_length);
-
/* Markers are present in this FPDU */
if (state->minfo[endpoint].valid && num_of_m > 0) {