diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-10-14 02:33:26 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-10-14 02:33:26 +0000 |
commit | 395dd4a88ea890f0be5dafad22cc5c8e6c2cd125 (patch) | |
tree | db8bb9f4fbae3704066e39164bc6a98788de281f /epan | |
parent | 7ac57a84119dcbeffb8eac6a7acd6450db0288f6 (diff) |
*Always* create a new data source when we decompress an IPv6 header.
Label the data sources for them as "6LoWPAN xxx", where "xxx" is the
type of compression, and label the data sources for reassembled
fragments as "Reassembled 6LoWPAN".
Fix the capitalization of "6LoWPAN".
Note that if reassembly fails, continuing dissection is not the right
thing to do, at least not if it failed because we don't *yet* have all
the fragments.
svn path=/trunk/; revision=45527
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-6lowpan.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/epan/dissectors/packet-6lowpan.c b/epan/dissectors/packet-6lowpan.c index 9c86b319b9..bb410d70b5 100644 --- a/epan/dissectors/packet-6lowpan.c +++ b/epan/dissectors/packet-6lowpan.c @@ -943,13 +943,9 @@ dissect_6lowpan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Compressed IPv6 packets. */ else if (tvb_get_bits8(next, 0, LOWPAN_PATTERN_HC1_BITS) == LOWPAN_PATTERN_HC1) { next = dissect_6lowpan_hc1(next, pinfo, lowpan_tree, -1, src_iid, dst_iid); - /* Add a new data source. */ - if (next) add_new_data_source(pinfo, next, "6LoWPAN"); } else if (tvb_get_bits8(next, 0, LOWPAN_PATTERN_IPHC_BITS) == LOWPAN_PATTERN_IPHC) { next = dissect_6lowpan_iphc(next, pinfo, lowpan_tree, -1, src_iid, dst_iid); - /* Add a new data source. */ - if (next) add_new_data_source(pinfo, next, "6LoWPAN"); } /* Unknown 6LoWPAN dispatch type */ else { @@ -1316,6 +1312,10 @@ dissect_6lowpan_hc1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint dg /* Link the reassembled tvbuff together. */ ipv6_tvb = lowpan_reassemble_ipv6(tvb, &ipv6, nhdr_list); + + /* Add a new data source for it. */ + add_new_data_source(pinfo, ipv6_tvb, "6LoWPAN HC1"); + return ipv6_tvb; } /* dissect_6lowpan_hc1 */ @@ -1733,6 +1733,10 @@ dissect_6lowpan_iphc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint d */ /* Reassemble the IPv6 packet. */ ipv6_tvb = lowpan_reassemble_ipv6(tvb, &ipv6, nhdr_list); + + /* Add a new data source for it. */ + add_new_data_source(pinfo, ipv6_tvb, "6LoWPAN IPHC"); + return ipv6_tvb; } /* dissect_6lowpan_iphc */ @@ -2331,19 +2335,13 @@ dissect_6lowpan_frag_first(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pinfo->fragmented = save_fragmented; - /* If reassembly was successful, then return the completed datagram. */ if (new_tvb) { + /* Reassembly was successful; return the completed datagram. */ return new_tvb; - } - /* If reassembly failed, display the payload fragment using the data dissector. */ - else { - /* - * BUG?: We could actually continue dissecting, since frag_tvb should contain - * a truncated IPv6 packet, and we know the reported length from dgram_size. - * - * But this seems to cause problems with the TCP dissector if we resubmit the - * datagram for reassembly again once we have the entire IPv6 packet. - */ + } else { + /* Reassembly was unsuccessful; show this fragment. This may + just mean that we don't yet have all the fragments, so + we should not just continue dissecting. */ call_dissector(data_handle, frag_tvb, pinfo, proto_tree_get_root(tree)); return NULL; } |