From d4f6480253cf303f70c3d831098adf7582403b8f Mon Sep 17 00:00:00 2001 From: Martin Mathieson Date: Tue, 23 Jun 2015 14:01:22 -0700 Subject: [PATCH] ISAKMP: fix Cisco fragmentation support. Last flag wasn't mapping to 'more fragments' properly, and reassembly should only be attempted on the last frame. Bug: 7940 Change-Id: I565f2b72b6eb68dc32e0f57a43a098a8f203a800 Reviewed-on: https://code.wireshark.org/review/9073 Petri-Dish: Martin Mathieson Reviewed-by: Pascal Quantin Reviewed-by: Martin Mathieson --- epan/dissectors/packet-isakmp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c index 182fe5a1d4..1127b060a7 100644 --- a/epan/dissectors/packet-isakmp.c +++ b/epan/dissectors/packet-isakmp.c @@ -3931,18 +3931,18 @@ dissect_cisco_fragmentation(tvbuff_t *tvb, int offset, int length, proto_tree *t NULL, seq-1, /* fragment sequence number, starting from 0 */ tvb_reported_length_remaining(tvb, offset), /* fragment length - to the end */ - last); /* More fragments? */ + !last); /* More fragments? */ defrag_isakmp_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled ISAKMP", frag_msg, &isakmp_frag_items, /* groups and items, using same as Cisco */ NULL, ptree); - if (defrag_isakmp_tvb) { /* take it all */ + if (last && defrag_isakmp_tvb) { /* take it all */ dissect_isakmp(defrag_isakmp_tvb, pinfo, ptree, NULL); } col_append_fstr(pinfo->cinfo, COL_INFO, " (%sMessage fragment %u%s)", - (frag_msg ? "Reassembled + " : ""), + (last && frag_msg ? "Reassembled + " : ""), seq, (last ? " - last" : "")); pinfo->fragmented = save_fragmented; }