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>
This commit is contained in:
AndersBroman 2016-01-25 16:14:42 +01:00 committed by Alexis La Goutte
parent a7c025fd14
commit 6bd7e928c0
1 changed files with 12 additions and 4 deletions

View File

@ -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;
}
}