mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-26 08:53:05 +00:00
add node hasip
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
6422cdf576
commit
af969f602c
1 changed files with 10 additions and 0 deletions
|
@ -135,6 +135,16 @@ func (node *Node) IPs() []netip.Addr {
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HasIP reports if a node has a given IP address.
|
||||||
|
func (node *Node) HasIP(i netip.Addr) bool {
|
||||||
|
for _, ip := range node.IPs() {
|
||||||
|
if ip.Compare(i) == 0 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// IsTagged reports if a device is tagged
|
// IsTagged reports if a device is tagged
|
||||||
// and therefore should not be treated as a
|
// and therefore should not be treated as a
|
||||||
// user owned device.
|
// user owned device.
|
||||||
|
|
Loading…
Reference in a new issue