mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-15 16:16:52 +01:00
Find a refused packet's tunnel from its header, ask the lighthouse when probing, and address review
This commit is contained in:
1 parent
0f07faab0e
commit
b69cf4ecb4
11 files changed
+306
-41
No files matched your search
@@ -129,6 +129,14 @@ func (u *TesterConn) SetDualStackAddrs(v4, v6 netip.AddrPort) {
|
||||
u.addrs.Store(a)
|
||||
}
|
||||
|
||||
// GetAddrFor returns the underlay address a send to dst leaves from, GetAddr when there is no route to dst
|
||||
func (u *TesterConn) GetAddrFor(dst netip.AddrPort) netip.AddrPort {
|
||||
if src, err := u.sourceFor(dst); err == nil {
|
||||
return src
|
||||
}
|
||||
return u.GetAddr()
|
||||
}
|
||||
|
||||
// sourceFor returns the address a send to dst leaves from
|
||||
func (u *TesterConn) sourceFor(dst netip.AddrPort) (netip.AddrPort, error) {
|
||||
a := u.addrs.Load()
|
||||
|
||||
Reference in new issue
Block a user