diff --git a/pkg/registrar/register.go b/pkg/registrar/register.go index 5a76770f..b7abcf0c 100644 --- a/pkg/registrar/register.go +++ b/pkg/registrar/register.go @@ -123,7 +123,12 @@ func registerNode( var ips []string for _, ip := range zosIps { ipV := net.IP(ip) - ips = append(ips, ipV.String()) + s := ipV.String() + if net.ParseIP(s) == nil { + log.Warn().Str("ip", s).Msg("skipping invalid IP from zos bridge") + continue + } + ips = append(ips, s) } return ips }(), diff --git a/pkg/registrar_light/register.go b/pkg/registrar_light/register.go index fcc2e2a0..33491ca1 100644 --- a/pkg/registrar_light/register.go +++ b/pkg/registrar_light/register.go @@ -4,6 +4,7 @@ import ( "context" "crypto/ed25519" "fmt" + "net" "time" "github.com/centrifuge/go-substrate-rpc-client/v4/types" @@ -121,8 +122,12 @@ func registerNode( IPs: func() []string { ips := make([]string, 0) for _, ip := range infs.Interfaces["zos"].IPs { - - ips = append(ips, ip.IP.String()) + s := ip.IP.String() + if net.ParseIP(s) == nil { + log.Warn().Str("ip", s).Msg("skipping invalid IP from zos bridge") + continue + } + ips = append(ips, s) } return ips }(),