Skip to content

Commit

Permalink
[analyzer] Use IPv6 + IPv4 where available (NASA-SW-VnV#158).
Browse files Browse the repository at this point in the history
This commit replaces uses of HTTPServer, which by default only listens
in IPv4 interfaces, with calls to a custom class HTTPServerIPv6, which
listens to IPv6, as well as IPv4 whenever dual-stack is supported.
  • Loading branch information
ivanperez-keera committed Oct 29, 2023
1 parent fb817bd commit 3a93e6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions analyzer/python/ikos/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,8 @@ def __init__(self):
try:
# try to start the http server on a random port
self.port = random.randint(8000, 9000)
self.httpd = http.HTTPServer(('', self.port),
ScanServerRequestHandler)
self.httpd = http.HTTPServerIPv6(('', self.port),
ScanServerRequestHandler)
except (OSError, IOError):
self.port = None # port already in use

Expand Down
4 changes: 2 additions & 2 deletions analyzer/python/ikos/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
from ikos import settings
from ikos.enums import Result, CheckKind
from ikos.highlight import CppLexer, HtmlFormatter, highlight
from ikos.http import HTTPServer, BaseHTTPRequestHandler
from ikos.http import HTTPServerIPv6, BaseHTTPRequestHandler
from ikos.log import printf
from ikos.output_db import OutputDatabase

Expand Down Expand Up @@ -337,7 +337,7 @@ def __init__(self, db, port=8080):
self.report = ViewReport(self.db)

try:
self.httpd = HTTPServer(('', self.port), RequestHandler)
self.httpd = HTTPServerIPv6(('', self.port), RequestHandler)
except (OSError, IOError) as e:
log.error("Could not start the HTTP server: %s" % e)
sys.exit(1)
Expand Down

0 comments on commit 3a93e6a

Please sign in to comment.