summaryrefslogtreecommitdiff
path: root/listeners.go
diff options
context:
space:
mode:
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