From 4744e915eb51a9defb5fb13c24ce2c8408d2fd98 Mon Sep 17 00:00:00 2001 From: Tom Thorogood Date: Fri, 9 Dec 2016 18:08:01 +1030 Subject: [PATCH] Fix tcp6-tls support in (*Server).ListenAndServe(). (#427) In the switch statement srv.Net is matched for tcp6-tls but then compared against tcp6 within the case statement. This causes tcp6-tls to be equivalent to tcp-tls and not specific to tcp6. The `network = "tcp6"` line was previously unreachable. This change corrects this and ensures tcp6-tls listens on IPv6 only. --- server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.go b/server.go index 1d40ee56..0ca6e008 100644 --- a/server.go +++ b/server.go @@ -339,7 +339,7 @@ func (srv *Server) ListenAndServe() error { network := "tcp" if srv.Net == "tcp4-tls" { network = "tcp4" - } else if srv.Net == "tcp6" { + } else if srv.Net == "tcp6-tls" { network = "tcp6" }