From 8080f1dd4186e9ae5172ca78e787d090f63bbdce Mon Sep 17 00:00:00 2001 From: david Date: Fri, 23 Dec 2011 21:14:53 +0000 Subject: [PATCH] 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. --- scripts/address-info.nse | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/address-info.nse b/scripts/address-info.nse index 4a2cff227..c915088cd 100644 --- a/scripts/address-info.nse +++ b/scripts/address-info.nse @@ -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) })