From ddc114bd85ba63260416d3994a85345123533497 Mon Sep 17 00:00:00 2001 From: worker-9 Date: Fri, 6 Aug 2021 14:22:21 -0400 Subject: [PATCH] node egress endpoint allowed ip bug --- netclient/server/grpc.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/netclient/server/grpc.go b/netclient/server/grpc.go index d4bae329..e634b507 100644 --- a/netclient/server/grpc.go +++ b/netclient/server/grpc.go @@ -7,6 +7,7 @@ import ( "log" "net" "strconv" + "strings" "time" nodepb "github.com/gravitl/netmaker/grpc" @@ -217,7 +218,8 @@ func GetPeers(macaddress string, network string, server string, dualstack bool, if err != nil { log.Println("ERROR ENCOUNTERED SETTING GATEWAY") } else { - if !ipnet.Contains(net.IP(node.Endpoint)) { + nodeEndpointArr := strings.Split(node.Endpoint, ":") + if len(nodeEndpointArr) == 2 && !ipnet.Contains(net.IP(nodeEndpointArr[0])) { allowedips = append(allowedips, *ipnet) } }