aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2015-09-12 06:35:22 +0100
committerMichael Mann <mmann78@netscape.net>2015-09-25 21:12:01 +0000
commit26ebfef4bb0e39ea8f0114ec20803bc9554465f8 (patch)
tree6f100d114b710daea973d5282db51363d47fff87 /epan
parent3b04a89828a12ee71aa6693aadb900862c9d3c75 (diff)
Don't display duplicate addresses without name resolution enabled
Change-Id: Ieb88e2632401cbf50c4ae51768a64df64d54a45d Reviewed-on: https://code.wireshark.org/review/10497 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r--epan/addr_resolv.h6
-rw-r--r--epan/address_types.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/epan/addr_resolv.h b/epan/addr_resolv.h
index c60e2c5180..10f5cd6a94 100644
--- a/epan/addr_resolv.h
+++ b/epan/addr_resolv.h
@@ -60,6 +60,12 @@ typedef struct _e_addr_resolve {
gboolean load_hosts_file_from_profile_only; /**< Whether to only load the hosts in the current profile, not hosts files */
} e_addr_resolve;
+#define ADDR_RESOLV_MACADDR(at) \
+ (((at)->type == AT_ETHER))
+
+#define ADDR_RESOLV_NETADDR(at) \
+ (((at)->type == AT_IPv4) || ((at)->type == AT_IPv6) || ((at)->type == AT_IPX))
+
struct hashether;
typedef struct hashether hashether_t;
diff --git a/epan/address_types.c b/epan/address_types.c
index 5601ae65ed..5e668128c3 100644
--- a/epan/address_types.c
+++ b/epan/address_types.c
@@ -1048,8 +1048,11 @@ gchar* address_with_resolution_to_str(wmem_allocator_t *scope, const address *ad
return wmem_strdup(scope, "");
/* No name resolution support, just return address string */
- if (at->addr_name_res_str == NULL)
+ if ((at->addr_name_res_str == NULL) ||
+ (ADDR_RESOLV_MACADDR(addr) && !gbl_resolv_flags.mac_name) ||
+ (ADDR_RESOLV_NETADDR(addr) && !gbl_resolv_flags.network_name)) {
return address_to_str(scope, addr);
+ }
len = at->addr_name_res_len() + at->addr_str_len(addr) + 4; /* For format of %s (%s) */