mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-05 16:46:39 +00:00
Guard isOwnAddress against nil wgInterface
This commit is contained in:
@@ -114,6 +114,9 @@ func (r *SysOps) validateRoute(prefix netip.Prefix) error {
|
||||
}
|
||||
|
||||
func (r *SysOps) isOwnAddress(addr netip.Addr) bool {
|
||||
if r.wgInterface == nil {
|
||||
return false
|
||||
}
|
||||
wgAddr := r.wgInterface.Address()
|
||||
return wgAddr.Network.Contains(addr) || (wgAddr.IPv6Net.IsValid() && wgAddr.IPv6Net.Contains(addr))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user