summaryrefslogtreecommitdiff
path: root/listeners.go
diff options
context:
space:
mode:
authorWilczyƄskiT <102859171+WilczynskiT@users.noreply.github.com>2022-08-18 00:10:57 +0200
committerGitHub <noreply@github.com>2022-08-17 16:10:57 -0600
commitc7772588bd44ceffcc0ba4817e4d43c826675379 (patch)
tree8a5f538b2b5a170460e6ca21fb159d37a9e6a335 /listeners.go
parenta944de4ab7acfdd114d11a2ca0d267110ba9c152 (diff)
core: Change net.IP to netip.Addr; use netip.Prefix (#4966)
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
Diffstat (limited to 'listeners.go')
-rw-r--r--listeners.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/listeners.go b/listeners.go
index c7d6d52..8698387 100644
--- a/listeners.go
+++ b/listeners.go
@@ -20,6 +20,7 @@ import (
"errors"
"fmt"
"net"
+ "net/netip"
"os"
"strconv"
"strings"
@@ -400,7 +401,7 @@ func (na NetworkAddress) isLoopback() bool {
if na.Host == "localhost" {
return true
}
- if ip := net.ParseIP(na.Host); ip != nil {
+ if ip, err := netip.ParseAddr(na.Host); err == nil {
return ip.IsLoopback()
}
return false
@@ -410,7 +411,7 @@ func (na NetworkAddress) isWildcardInterface() bool {
if na.Host == "" {
return true
}
- if ip := net.ParseIP(na.Host); ip != nil {
+ if ip, err := netip.ParseAddr(na.Host); err == nil {
return ip.IsUnspecified()
}
return false