mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-19 07:05:57 +08:00
add check for nil peer.Endpoint
This commit is contained in:
@@ -106,6 +106,9 @@ func FlushPeerRoutes(iface, currentAddr string, peers []wgtypes.Peer) {
|
|||||||
for _, allowedIP := range peer.AllowedIPs {
|
for _, allowedIP := range peer.AllowedIPs {
|
||||||
deleteRoute(iface, &allowedIP, currentAddr)
|
deleteRoute(iface, &allowedIP, currentAddr)
|
||||||
}
|
}
|
||||||
|
if peer.Endpoint == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if hasRoute && !ncutils.IpIsPrivate(peer.Endpoint.IP) {
|
if hasRoute && !ncutils.IpIsPrivate(peer.Endpoint.IP) {
|
||||||
ipNet, err := ncutils.GetIPNetFromString(peer.Endpoint.IP.String())
|
ipNet, err := ncutils.GetIPNetFromString(peer.Endpoint.IP.String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user