mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-16 15:26:40 +00:00
* Ensure route settlement on iOS before handling DNS responses to prevent bypassing the tunnel. * add more logs * rollback debug changes * rollback changes * [client] Improve logging and add comments for iOS route settlement logic - Switch iOS route settlement log level from Debug to Trace for finer control. - Add clarifying comments for `waitForRouteSettlement` on non-iOS platforms. --------- Co-authored-by: mlsmaycon <mlsmaycon@gmail.com>
21 lines
552 B
Go
21 lines
552 B
Go
//go:build ios
|
|
|
|
package dnsinterceptor
|
|
|
|
import (
|
|
"time"
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
const routeSettleDelay = 500 * time.Millisecond
|
|
|
|
// waitForRouteSettlement introduces a short delay on iOS to allow
|
|
// setTunnelNetworkSettings to apply route changes before the DNS
|
|
// response reaches the application. Without this, the first request
|
|
// to a newly resolved domain may bypass the tunnel.
|
|
func waitForRouteSettlement(logger *log.Entry) {
|
|
logger.Tracef("waiting %v for iOS route settlement", routeSettleDelay)
|
|
time.Sleep(routeSettleDelay)
|
|
}
|