diff --git a/server.go b/server.go index 0568ae16..a250df1a 100644 --- a/server.go +++ b/server.go @@ -14,6 +14,7 @@ import ( "net" "runtime" "strconv" + "strings" "sync" "sync/atomic" "time" @@ -2075,6 +2076,13 @@ func parseListeners(addrs []string) ([]string, []string, bool, error) { continue } + // Strip IPv6 zone id if present since net.ParseIP does not + // handle it. + zoneIndex := strings.LastIndex(host, "%") + if zoneIndex > 0 { + host = host[:zoneIndex] + } + // Parse the IP. ip := net.ParseIP(host) if ip == nil {