diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-11-27 12:29:13 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-11-28 18:07:22 +0000 |
commit | f1b37bc8fcb4f7f8c5be8d2ab9c026dc4a5c77a8 (patch) | |
tree | 1f7d2bdb76beea1274eeb9ab7e053cd4af97ed57 /epan/dissectors | |
parent | 3355ed6b7ef7d57c75977b0459adf8d219048581 (diff) |
Endpoint: wrong filter when select a UDP endpoint (INVALID == a.x.y.z ...)
Change-Id: Ie46d6c201df0b0164a8bf96c02d6430734fd2948
Reviewed-on: https://code.wireshark.org/review/5518
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-udp.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/epan/dissectors/packet-udp.c b/epan/dissectors/packet-udp.c index 6632ffe1db..86f874b919 100644 --- a/epan/dissectors/packet-udp.c +++ b/epan/dissectors/packet-udp.c @@ -333,9 +333,30 @@ udpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_ return 1; } -static const char* udp_host_get_filter_type(hostlist_talker_t* host _U_, conv_filter_type_e filter) +static const char* udp_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) { - return udp_conv_get_filter_type(NULL, filter); + + if (filter == CONV_FT_SRC_PORT) + return "udp.srcport"; + + if (filter == CONV_FT_DST_PORT) + return "udp.dstport"; + + if (filter == CONV_FT_ANY_PORT) + return "udp.port"; + + if(!host) { + return CONV_FILTER_INVALID; + } + + if (filter == CONV_FT_SRC_ADDRESS || filter == CONV_FT_DST_ADDRESS || filter == CONV_FT_ANY_ADDRESS) { + if (host->myaddress.type == AT_IPv4) + return "ip.src"; + if (host->myaddress.type == AT_IPv6) + return "ipv6.src"; + } + + return CONV_FILTER_INVALID; } static hostlist_dissector_info_t udp_host_dissector_info = {&udp_host_get_filter_type}; |