mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
ipn/ipnlocal: don't warn about serve listener failing on IPv6-less machines
Fixes #6303 Change-Id: Ie1ce12938f68dfa0533246bbe3b9d7f3e749a243 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
90bd74fc05
commit
3114eacbb8
@@ -400,6 +400,22 @@ func (s *State) EqualFiltered(s2 *State, useInterface InterfaceFilter, useIP IPF
|
||||
return true
|
||||
}
|
||||
|
||||
// HasIP reports whether any interface has the provided IP address.
|
||||
func (s *State) HasIP(ip netip.Addr) bool {
|
||||
if s == nil {
|
||||
return false
|
||||
}
|
||||
want := netip.PrefixFrom(ip, ip.BitLen())
|
||||
for _, pv := range s.InterfaceIPs {
|
||||
for _, p := range pv {
|
||||
if p == want {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func interfacesEqual(a, b Interface) bool {
|
||||
return a.Index == b.Index &&
|
||||
a.MTU == b.MTU &&
|
||||
|
Reference in New Issue
Block a user