mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-17 07:36:52 +01:00
Probe for another path when the data path finds a tunnel's remote unreachable
This commit is contained in:
1 parent
0ff077fea3
commit
2fd9966fef
17 files changed
+242
-54
No files matched your search
+4
-1
@@ -217,13 +217,16 @@ func (u *TesterConn) WriteTo(b []byte, addr netip.AddrPort) error {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
func (u *TesterConn) WriteBatch(bufs [][]byte, addrs []netip.AddrPort) (int, error) {
|
||||
func (u *TesterConn) WriteBatch(bufs [][]byte, addrs []netip.AddrPort, failed func(i int, err error)) (int, error) {
|
||||
written := 0
|
||||
for i, b := range bufs {
|
||||
if err := u.WriteTo(b, addrs[i]); err == nil {
|
||||
written++
|
||||
} else {
|
||||
u.l.Debug("failed to write packet in batch", "udpAddr", addrs[i], "error", err)
|
||||
if failed != nil {
|
||||
failed(i, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return written, nil
|
||||
|
||||
Reference in new issue
Block a user