From 86fdad2bfa1ae66134eaa558c185714f091f888b Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 24 May 2012 22:07:50 +0000 Subject: [PATCH] minor update --- lib/controller/checks.py | 6 ++++++ lib/core/common.py | 8 ++++++-- lib/core/option.py | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index d998524a2..d808918e9 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -993,6 +993,12 @@ def checkConnection(suppressOutput=False): logger.info(infoMsg) try: + if conf.ipv6: + warnMsg = "always check connection to provided " + warnMsg += "IPv6 address with a tool like ping6 " + warnMsg += "(e.g. 'ping6 fe80::20c:29ff:fea8:6bf1%vmnet8')" + singleTimeWarnMessage(warnMsg) + page, _ = Request.queryPage(content=True, noteResponseTime=False) kb.originalPage = kb.pageTemplate = page diff --git a/lib/core/common.py b/lib/core/common.py index 233de59d7..9c3ea022f 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1086,7 +1086,11 @@ def parseTargetUrl(): conf.scheme = __urlSplit[0].strip().lower() if not conf.forceSSL else "https" conf.path = __urlSplit[2].strip() - conf.hostname = __hostnamePort[0].strip().strip("[]") + conf.hostname = __hostnamePort[0].strip() + + conf.ipv6 = conf.hostname != conf.hostname.strip("[]") + conf.hostname = conf.hostname.strip("[]") + try: _ = conf.hostname.encode("idna") @@ -1111,7 +1115,7 @@ def parseTargetUrl(): if __urlSplit[3]: conf.parameters[PLACE.GET] = urldecode(__urlSplit[3]) if __urlSplit[3] and urlencode(DEFAULT_GET_POST_DELIMITER, None) not in __urlSplit[3] else __urlSplit[3] - conf.url = "%s://%s:%d%s" % (conf.scheme, ("[%s]" % conf.hostname) if __hostnamePort[0].strip("[]") != __hostnamePort[0] else conf.hostname, conf.port, conf.path) + conf.url = "%s://%s:%d%s" % (conf.scheme, ("[%s]" % conf.hostname) if conf.ipv6 else conf.hostname, conf.port, conf.path) conf.url = conf.url.replace(URI_QUESTION_MARKER, '?') if not conf.referer and intersect(REFERER_ALIASES, conf.testParameter, True): diff --git a/lib/core/option.py b/lib/core/option.py index fe05b0b3d..73490aeb2 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1388,6 +1388,7 @@ def __setConfAttributes(): conf.hashDBFile = None conf.httpHeaders = [] conf.hostname = None + conf.ipv6 = False conf.multipleTargets = False conf.outputPath = None conf.paramDict = {}