Skip to content

Commit

Permalink
Fix tcp6-tls support in (*Server).ListenAndServe(). (#427)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tmthrgd authored and miekg committed Dec 9, 2016
1 parent f4d2b08 commit 4744e91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down

0 comments on commit 4744e91

Please sign in to comment.