From 74541a9596eead6647c592de9aa46797c2dffa84 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Thu, 29 Oct 2015 09:23:55 -0400 Subject: Don't allow multiple registrations of a protocol in dissector tables. The target here is the Decode As dialog where protocols have multiple registrations into a dissector table and that shows up as multiple entries in the Decode As dialog list with the same name so users are unsure which "dissector" they are choosing. The "default" behavior (done in this commit) is to not allow duplicates for a dissector table, whether its part of Decode As or not. It's just ENFORCED for Decode As. Bug: 3949 Change-Id: Ibe14fa61aaeca0881f9cc39b78799e314b5e8127 Reviewed-on: https://code.wireshark.org/review/11405 Petri-Dish: Michael Mann Reviewed-by: Michael Mann --- epan/dissectors/packet-mpls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'epan/dissectors/packet-mpls.c') diff --git a/epan/dissectors/packet-mpls.c b/epan/dissectors/packet-mpls.c index 87aa63245c..ec1b1ff26f 100644 --- a/epan/dissectors/packet-mpls.c +++ b/epan/dissectors/packet-mpls.c @@ -590,7 +590,7 @@ proto_register_mpls(void) /* FF: mpls subdissector table is indexed by label */ mpls_subdissector_table = register_dissector_table("mpls.label", "MPLS protocol", - FT_UINT32, BASE_DEC); + FT_UINT32, BASE_DEC, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE); proto_mpls = proto_register_protocol("MultiProtocol Label Switching Header", "MPLS", "mpls"); proto_pw_ach = proto_register_protocol(PW_ACH, @@ -605,7 +605,7 @@ proto_register_mpls(void) register_dissector("mpls", dissect_mpls, proto_mpls); - pw_ach_subdissector_table = register_dissector_table("pwach.channel_type", "PW Associated Channel Type", FT_UINT16, BASE_HEX); + pw_ach_subdissector_table = register_dissector_table("pwach.channel_type", "PW Associated Channel Type", FT_UINT16, BASE_HEX, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE); module_mpls = prefs_register_protocol( proto_mpls, NULL ); -- cgit v1.2.3