1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-20 05:09:02 +00:00

Exclude ::1 from being an IPv4-compatible address (0.0.0.1) in address-info.

It said:
|_address-info: IPv4-compatible; IPv4 address: 0.0.0.1
which is not right.
This commit is contained in:
david
2011-12-23 21:14:53 +00:00
parent d1ef18a245
commit 8080f1dd41

View File

@@ -166,8 +166,9 @@ local function do_ipv6(addr)
output = {}
if matches(addr, "0000:0000:0000:0000:0000:0000:XXXX:XXXX") then
-- RFC 4291 2.5.5.1.
if matches(addr, "0000:0000:0000:0000:0000:0000:XXXX:XXXX")
and not matches(addr, "0000:0000:0000:0000:0000:0000:0000:0001") then
-- RFC 4291 2.5.5.1. Specifically exclude ::1 for localhost.
local ipv4 = { addr[13], addr[14], addr[15], addr[16] }
return format_output("IPv4-compatible",
{ "IPv4 address: " .. format_ipv4(ipv4) })