mirror of
https://github.com/gravitl/netmaker.git
synced 2025-02-27 01:23:00 +08:00
node egress endpoint allowed ip bug
This commit is contained in:
parent
013230eb1e
commit
ddc114bd85
1 changed files with 3 additions and 1 deletions
|
@ -7,6 +7,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
nodepb "github.com/gravitl/netmaker/grpc"
|
nodepb "github.com/gravitl/netmaker/grpc"
|
||||||
|
@ -217,7 +218,8 @@ func GetPeers(macaddress string, network string, server string, dualstack bool,
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("ERROR ENCOUNTERED SETTING GATEWAY")
|
log.Println("ERROR ENCOUNTERED SETTING GATEWAY")
|
||||||
} else {
|
} 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)
|
allowedips = append(allowedips, *ipnet)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue