MCPcopy
hub / github.com/juanfont/headscale / isSelfClient

Function isSelfClient

integration/helpers.go:710–727  ·  view source on GitHub ↗

isSelfClient determines if the given address belongs to the client itself. Used to avoid self-ping operations in connectivity tests by checking hostname and IP address matches.

(client TailscaleClient, addr string)

Source from the content-addressed store, hash-verified

708// Used to avoid self-ping operations in connectivity tests by checking
709// hostname and IP address matches.
710func isSelfClient(client TailscaleClient, addr string) bool {
711 if addr == client.Hostname() {
712 return true
713 }
714
715 ips, err := client.IPs()
716 if err != nil {
717 return false
718 }
719
720 for _, ip := range ips {
721 if ip.String() == addr {
722 return true
723 }
724 }
725
726 return false
727}
728
729// assertClientsState validates the status and netmap of a list of clients for general connectivity.
730// Runs parallel validation of status, netcheck, and netmap for all clients to ensure

Callers 1

pingDerpAllHelperFunction · 0.85

Calls 3

HostnameMethod · 0.65
IPsMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected