aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2017-04-12 11:15:08 -0400
committerMichael Mann <mmann78@netscape.net>2017-04-13 01:30:24 +0000
commita96dc7bdd580fdbe4934b5de483742689b553a0a (patch)
treeed4d6fb4a2ab229de396eecd608cf7455c521cda
parent6c096f31ac6bbe2f0b7e0fd43dddb5419a8b2a3d (diff)
Require MLE to have IEEE802.15.4 as an underlying layer.
MLE runs over UDP, but presumes IEEE802.15.4 is also an underlying layer. Enforce it by ensuring IEEE802.15.4 protocol data is present. Bug: 13589 Change-Id: I5fd54244499980637c121f5f8d1fb2d152d31c73 Reviewed-on: https://code.wireshark.org/review/21053 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/packet-mle.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/epan/dissectors/packet-mle.c b/epan/dissectors/packet-mle.c
index a155178025..d1e722c386 100644
--- a/epan/dissectors/packet-mle.c
+++ b/epan/dissectors/packet-mle.c
@@ -552,7 +552,7 @@ dissect_mle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
proto_tree *header_tree = NULL;
guint8 security_suite;
guint aux_length = 0;
- ieee802154_packet *packet = (ieee802154_packet *)wmem_alloc(wmem_packet_scope(), sizeof(ieee802154_packet));
+ ieee802154_packet *packet;
ieee802154_packet *original_packet;
ieee802154_payload_info_t payload_info;
ieee802154_hints_t *ieee_hints;
@@ -565,12 +565,15 @@ dissect_mle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
guint8 tlv_type, tlv_len;
proto_tree *tlv_tree;
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "MLE");
- col_clear(pinfo->cinfo, COL_INFO);
-
ieee_hints = (ieee802154_hints_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_ieee802154, 0);
+ if (ieee_hints == NULL) {
+ /* For now, MLE only supported with IEEE802.15.4 as an underlying layer */
+ return 0;
+ }
original_packet = (ieee802154_packet *)ieee_hints->packet;
+ packet = wmem_new0(wmem_packet_scope(), ieee802154_packet);
+
/* Copy IEEE 802.15.4 Source Address */
packet->src_addr_mode = original_packet->src_addr_mode;
if (packet->src_addr_mode == IEEE802154_FCF_ADDR_EXT) {
@@ -582,6 +585,9 @@ dissect_mle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
/* Copy IEEE 802.15.4 Source PAN ID */
packet->src_pan = original_packet->src_pan;
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MLE");
+ col_clear(pinfo->cinfo, COL_INFO);
+
/* Create the protocol tree. */
proto_root = proto_tree_add_item(tree, proto_mle, tvb, 0, tvb_reported_length(tvb), ENC_NA);
mle_tree = proto_item_add_subtree(proto_root, ett_mle);