diff options
| author | WilczyĆskiT <102859171+WilczynskiT@users.noreply.github.com> | 2022-08-18 00:10:57 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-17 16:10:57 -0600 | 
| commit | c7772588bd44ceffcc0ba4817e4d43c826675379 (patch) | |
| tree | 8a5f538b2b5a170460e6ca21fb159d37a9e6a335 /listeners.go | |
| parent | a944de4ab7acfdd114d11a2ca0d267110ba9c152 (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.go | 5 | 
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  | 
