diff options
-rw-r--r-- | epan/addr_resolv.h | 6 | ||||
-rw-r--r-- | epan/address_types.c | 5 |
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) */ |