mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-13 18:29:07 +02:00
iOS applies the tunnel address out of band, after handing the engine the tun fd, so the receiver bound to that address a moment too early and failed with EADDRNOTAVAIL. Nothing retried it, leaving the peer able to send but never to receive for the life of the connection. Wait for the address to appear and bind then, and let a rebind start a receiver that is down rather than skipping it. Only the subsystems that asked to be bound are bound, so the SSH sessions and DNS queries that other listeners are carrying are left alone. The wait itself is iOS-only: every other platform assigns the address in the call chain that creates the interface, or is handed one that already carries it, so there it compiles down to nothing.
21 lines
700 B
Go
21 lines
700 B
Go
//go:build !ios
|
|
|
|
package internal
|
|
|
|
import "net/netip"
|
|
|
|
// overlayWaiter carries no state off iOS. Every other platform assigns the
|
|
// overlay address in the same call chain that creates the interface, or hands
|
|
// the engine an interface that already carries it, so a listener bound right
|
|
// after has nothing to wait for. See the iOS variant for what the wait is.
|
|
type overlayWaiter struct{}
|
|
|
|
// overlayAddrReady reports whether ip can be bound. Always true here.
|
|
func (e *Engine) overlayAddrReady(netip.Addr) bool {
|
|
return true
|
|
}
|
|
|
|
// armOverlayWatch has nothing to watch here and is never reached, since
|
|
// overlayAddrReady never refuses.
|
|
func (e *Engine) armOverlayWatch(string, overlayRebind) {}
|