mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-15 20:36:52 +01:00
Probe a tunnel's other remotes when its current one is unreachable
This commit is contained in:
1 parent
f552cebc51
commit
0ff077fea3
8 files changed
+383
-18
No files matched your search
@@ -0,0 +1,18 @@
|
||||
package udp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
// IsUnreachable reports whether a send failed because this host has no way to reach the destination from where it
|
||||
// is now, rather than for something transient. Moving from a dual stack network to one without IPv6 turns every send
|
||||
// to an IPv6 remote into one of these.
|
||||
func IsUnreachable(err error) bool {
|
||||
return errors.Is(err, windows.WSAENETUNREACH) ||
|
||||
errors.Is(err, windows.WSAEHOSTUNREACH) ||
|
||||
errors.Is(err, windows.WSAEADDRNOTAVAIL) ||
|
||||
errors.Is(err, windows.WSAEAFNOSUPPORT) ||
|
||||
errors.Is(err, ErrInvalidIPv6RemoteForSocket)
|
||||
}
|
||||
Reference in new issue
Block a user