mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-09 20:29:23 +02:00
fix(configuration/sources/files/wireguard): fix parsing ipv6 endpoint port
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"gopkg.in/ini.v1"
|
||||
)
|
||||
@@ -84,10 +83,7 @@ func parseWireguardPeerSection(peerSection *ini.Section) (
|
||||
host, port, err := net.SplitHostPort(*endpoint)
|
||||
if err == nil {
|
||||
endpointIP = &host
|
||||
// IPv6 hosts contain colons; port is managed by the provider for those
|
||||
if !strings.Contains(host, ":") {
|
||||
endpointPort = &port
|
||||
}
|
||||
endpointPort = &port
|
||||
} else {
|
||||
endpointIP = endpoint
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user