Only say we have a new resolved MAC address if it's actually *new*.

If we aren't changing the resolved name, it's not new.

This prevents us from perpetually "resolving" the address.  If we have
ARP packets that cause us to map a MAC address to a host name, based on
the ARP packet saying the MAC address corresponds to a given resolved IP
address, then each time we dissect the packet, the address will be
"resolved" - and each time we have new resolved addresses as a result of
that, we'll redissect the displayed packets so that they show the
resolved address, and we'll forever be redissecting.

Change-Id: I445e92f407d52a4ed5986721ffcc472f86e99431
Reviewed-on: https://code.wireshark.org/review/14236
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2016-02-29 03:19:19 -08:00
parent d5f2db6a7f
commit 0e5a73fa4e
1 changed files with 5 additions and 3 deletions

View File

@ -1603,9 +1603,11 @@ add_eth_name(const guint8 *addr, const gchar *name)
tp = eth_hash_new_entry(addr, FALSE);
}
g_strlcpy(tp->resolved_name, name, MAXNAMELEN);
tp->status = HASHETHER_STATUS_RESOLVED_NAME;
new_resolved_objects = TRUE;
if (strcmp(tp->resolved_name, name) != 0) {
g_strlcpy(tp->resolved_name, name, MAXNAMELEN);
tp->status = HASHETHER_STATUS_RESOLVED_NAME;
new_resolved_objects = TRUE;
}
return tp;
} /* add_eth_name */