parent
c4abe025d0
commit
6af96bfdb7
1 changed files with 11 additions and 0 deletions
11
rpcserver.go
11
rpcserver.go
|
@ -33,6 +33,7 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
@ -194,6 +195,16 @@ func parseListeners(addrs []string) ([]string, []string, error) {
|
|||
continue
|
||||
}
|
||||
|
||||
// Remove the IPv6 zone from the host, if present. The zone
|
||||
// prevents ParseIP from correctly parsing the IP address.
|
||||
// ResolveIPAddr is intentionally not used here due to the
|
||||
// possibility of leaking a DNS query over Tor if the host is a
|
||||
// hostname and not an IP address.
|
||||
zoneIndex := strings.Index(host, "%")
|
||||
if zoneIndex != -1 {
|
||||
host = host[:zoneIndex]
|
||||
}
|
||||
|
||||
// Parse the IP.
|
||||
ip := net.ParseIP(host)
|
||||
if ip == nil {
|
||||
|
|
Loading…
Reference in a new issue