diff options
Diffstat (limited to 'epan/dissectors/packet-mikey.c')
-rw-r--r-- | epan/dissectors/packet-mikey.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/epan/dissectors/packet-mikey.c b/epan/dissectors/packet-mikey.c index df573fc89e..67abc06086 100644 --- a/epan/dissectors/packet-mikey.c +++ b/epan/dissectors/packet-mikey.c @@ -591,17 +591,17 @@ static int dissect_payload(int payload, mikey_t *mikey, tvbuff_t *tvb, packet_in /* Initialize the protocol and registered fields */ -static int proto_mikey = -1; +static int proto_mikey; static int hf_mikey[MAX_POS+1]; static int hf_mikey_sp_param[SP_MAX+1]; static int hf_mikey_pl[PL_MAX]; /* Initialize the subtree pointers */ -static gint ett_mikey = -1; -static gint ett_mikey_payload = -1; -static gint ett_mikey_sp_param = -1; -static gint ett_mikey_hdr_id = -1; -static gint ett_mikey_enc_data = -1; +static gint ett_mikey; +static gint ett_mikey_payload; +static gint ett_mikey_sp_param; +static gint ett_mikey_hdr_id; +static gint ett_mikey_enc_data; static dissector_handle_t mikey_handle; @@ -1201,7 +1201,7 @@ dissect_payload_general_ext(mikey_t *mikey _U_, tvbuff_t *tvb, packet_info *pinf parent = proto_tree_get_parent(tree); if (type == 1) { /* For SDP-IDs, show a string instead of raw bytes */ - proto_tree_add_item(tree, hf_mikey[POS_GENERAL_EXT_VALUE], tvb, 4, data_len, ENC_ASCII|ENC_NA); + proto_tree_add_item(tree, hf_mikey[POS_GENERAL_EXT_VALUE], tvb, 4, data_len, ENC_ASCII); } else { proto_tree_add_item(tree, hf_mikey[POS_GENERAL_EXT_DATA], tvb, 4, data_len, ENC_NA); } @@ -1310,6 +1310,9 @@ dissect_mikey(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U if (hf == -1) hf = 0; + if (hf_mikey_pl[hf] == 0) + return -1; + sub_ti = proto_tree_add_item(mikey_tree, hf_mikey_pl[hf], subtvb, 0, -1, ENC_NA); mikey_payload_tree = proto_item_add_subtree(sub_ti, ett_mikey_payload); @@ -1838,6 +1841,7 @@ proto_reg_handoff_mikey(void) dissector_add_string("key_mgmt", "mikey", mikey_handle); dissector_add_uint_with_preference("tcp.port", PORT_MIKEY, mikey_handle); dissector_add_uint_with_preference("udp.port", PORT_MIKEY, mikey_handle); + dissector_add_string("media_type", "application/mikey", mikey_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html |