mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-05 20:54:18 +08:00
add check for nil peer.Endpoint
This commit is contained in:
parent
a7ff340692
commit
6f739defc6
1 changed files with 3 additions and 0 deletions
|
@ -106,6 +106,9 @@ func FlushPeerRoutes(iface, currentAddr string, peers []wgtypes.Peer) {
|
|||
for _, allowedIP := range peer.AllowedIPs {
|
||||
deleteRoute(iface, &allowedIP, currentAddr)
|
||||
}
|
||||
if peer.Endpoint == nil {
|
||||
continue
|
||||
}
|
||||
if hasRoute && !ncutils.IpIsPrivate(peer.Endpoint.IP) {
|
||||
ipNet, err := ncutils.GetIPNetFromString(peer.Endpoint.IP.String())
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue