ISAKMP: fix Cisco fragmentation support.
authorMartin Mathieson <martin.r.mathieson@googlemail.com>
Tue, 23 Jun 2015 21:01:22 +0000 (14:01 -0700)
committerMartin Mathieson <martin.r.mathieson@googlemail.com>
Tue, 23 Jun 2015 21:32:25 +0000 (21:32 +0000)
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 <martin.r.mathieson@googlemail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
epan/dissectors/packet-isakmp.c

index 182fe5a1d42a448bb70bf3b43736901f98a4d176..1127b060a748abba4a5f5e33f60b7db57b6432f9 100644 (file)
@@ -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;
   }