mirror of
https://github.com/nmap/nmap.git
synced 2026-09-09 05:05:48 +00:00
Fix host sorting in Ndiff. Fixes #591
This commit is contained in:
parent
a8ff212b84
commit
9f858f6d3e
2 changed files with 8 additions and 3 deletions
|
|
@ -1,5 +1,9 @@
|
|||
# Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o [Ndiff][GH#591] Fix a bug where hosts with the same IP but different
|
||||
hostnames were shown as changing hostnames between scans. Made sort stable
|
||||
with regard to hostnames. [Daniel Miller]
|
||||
|
||||
o [NSE][GH#533] Removed ssl-google-cert-catalog, since Google shut off that
|
||||
service at some point. Reported by Brian Morin.
|
||||
|
||||
|
|
|
|||
|
|
@ -127,11 +127,12 @@ class Host(object):
|
|||
def get_id(self):
|
||||
"""Return an id that is used to determine if hosts are "the same"
|
||||
across scans."""
|
||||
hid = None
|
||||
if len(self.addresses) > 0:
|
||||
return str(sorted(self.addresses)[0])
|
||||
hid = "%-40s" % (str(sorted(self.addresses)[0]))
|
||||
if len(self.hostnames) > 0:
|
||||
return str(sorted(self.hostnames)[0])
|
||||
return id(self)
|
||||
return (hid or " " * 40) + str(sorted(self.hostnames)[0])
|
||||
return hid or id(self)
|
||||
|
||||
def format_name(self):
|
||||
"""Return a human-readable identifier for this host."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue