diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-05-11 12:14:27 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-05-12 06:29:01 +0000 |
commit | b217c8fea14731ea638e8312c78d02d7900752fa (patch) | |
tree | 656b1385aef0ab3dc7d5d59decf18e5a1d67f87c | |
parent | 03a8e01cfcc4ee8699f15b1ca41de6f63c6ae71e (diff) |
cli: make "-z host,ipv4" filter actually work
Respect the "ipv4" and "ipv6" filters and actually restrict the output.
Change-Id: I06ee62ee2c85cb45fb33a52e86ce3698452d175f
Fixes: v1.11.0-rc1-2592-ge3cccd17f4 ("Get rid of some users the addrinfo_list.")
Reviewed-on: https://code.wireshark.org/review/27452
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | ui/cli/tap-hosts.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/ui/cli/tap-hosts.c b/ui/cli/tap-hosts.c index e3a1bc548c..398ecf9029 100644 --- a/ui/cli/tap-hosts.c +++ b/ui/cli/tap-hosts.c @@ -23,8 +23,8 @@ void register_tap_listener_hosts(void); -gboolean dump_v4 = FALSE; -gboolean dump_v6 = FALSE; +static gboolean dump_v4 = FALSE; +static gboolean dump_v6 = FALSE; #define TAP_NAME "hosts" @@ -64,14 +64,18 @@ hosts_draw(void *dummy _U_) printf("# Host data gathered from %s\n", cfile.filename); printf("\n"); - ipv4_hash_table = get_ipv4_hash_table(); - if (ipv4_hash_table) { - wmem_map_foreach( ipv4_hash_table, ipv4_hash_table_print_resolved, NULL); + if (dump_v4) { + ipv4_hash_table = get_ipv4_hash_table(); + if (ipv4_hash_table) { + wmem_map_foreach( ipv4_hash_table, ipv4_hash_table_print_resolved, NULL); + } } - ipv6_hash_table = get_ipv6_hash_table(); - if (ipv6_hash_table) { - wmem_map_foreach( ipv6_hash_table, ipv6_hash_table_print_resolved, NULL); + if (dump_v6) { + ipv6_hash_table = get_ipv6_hash_table(); + if (ipv6_hash_table) { + wmem_map_foreach( ipv6_hash_table, ipv6_hash_table_print_resolved, NULL); + } } } |