aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndersBroman <anders.broman@ericsson.com>2016-01-25 16:14:42 +0100
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2016-01-25 18:33:02 +0000
commit6bd7e928c08167e8ee73b43a156c6fc0c20e744a (patch)
tree0a9cbdb8a8b1e65d404c7704dc39f6606d46aa0b
parenta7c025fd142a291f1cb9e405a2a6e24a842be058 (diff)
TDMoP Dont register UDP port 0 or Ethertype 0.
Change-Id: I7e724a6390fbe75993c8663c8c43937a40d8250d Reviewed-on: https://code.wireshark.org/review/13528 Reviewed-by: Anders Broman <a.broman58@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
-rw-r--r--epan/dissectors/packet-tdmop.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/epan/dissectors/packet-tdmop.c b/epan/dissectors/packet-tdmop.c
index e2b335f8eb..a2e32f940d 100644
--- a/epan/dissectors/packet-tdmop.c
+++ b/epan/dissectors/packet-tdmop.c
@@ -352,8 +352,12 @@ void proto_reg_handoff_tdmop(void)
if (!init)
{
tdmop_handle = create_dissector_handle(dissect_tdmop, proto_tdmop);
- dissector_add_uint("udp.port", pref_tdmop_udpport, tdmop_handle);
- dissector_add_uint("ethertype", pref_tdmop_ethertype, tdmop_handle);
+ if (pref_tdmop_udpport) {
+ dissector_add_uint("udp.port", pref_tdmop_udpport, tdmop_handle);
+ }
+ if (pref_tdmop_ethertype) {
+ dissector_add_uint("ethertype", pref_tdmop_ethertype, tdmop_handle);
+ }
lapd_handle = find_dissector("lapd-bitstream");
data_handle = find_dissector("data");
current_tdmop_ethertype = pref_tdmop_ethertype;
@@ -363,13 +367,17 @@ void proto_reg_handoff_tdmop(void)
if (current_tdmop_ethertype != pref_tdmop_ethertype)
{
dissector_delete_uint("ethertype", current_tdmop_ethertype, tdmop_handle);
- dissector_add_uint("ethertype", pref_tdmop_ethertype, tdmop_handle);
+ if (pref_tdmop_ethertype) {
+ dissector_add_uint("ethertype", pref_tdmop_ethertype, tdmop_handle);
+ }
current_tdmop_ethertype = pref_tdmop_ethertype;
}
if (current_tdmop_udpport != pref_tdmop_udpport)
{
dissector_delete_uint("udp.port", current_tdmop_udpport, tdmop_handle);
- dissector_add_uint("udp.port", pref_tdmop_udpport, tdmop_handle);
+ if (pref_tdmop_udpport) {
+ dissector_add_uint("udp.port", pref_tdmop_udpport, tdmop_handle);
+ }
current_tdmop_udpport = pref_tdmop_udpport;
}
}