cloudflare / keyless

Cloudflare's Keyless SSL Server Reference Implementation
Other
275 stars 80 forks source link

Added IPv6 code into free-port.pl #73

Closed mahtin closed 10 years ago

mahtin commented 10 years ago

Added IPv6 code into free-port.pl via the command line -6 flag.

abraxxa commented 10 years ago

Consider using IO::Socket::IP for transparent handling of both IPv4 and IPv6.

mahtin commented 10 years ago

While "IO::Socket::IP" would be the correct way to go for code doing a generalized connection towards a remote dual-stacked host; this code is used for finding a free port that can be used by the test suite on the local machine. That test suite can decide if a v4 or v6 test needs to be performed; hence explicitly select v4 or v6 for this code.

That said; to be honest; it's not clear that the returned port number is any different when using the -6 flag. This is very much platform dependent.

0xhaven commented 10 years ago

free-port.pl is a script only used for convenience in the test harness and the -6 argument is never actually used. This change requires the installation of an additional non-CORE perl module to build without a clear use. I'd suggest reverting it.