remove DNS lookups from IPv6 check, close the connection

log ipv6 availability logic

more debugging for ipv6 availability checks

more debugging for ipv6 availability checks
This commit is contained in:
Alex
2025-02-12 20:49:57 -05:00
committed by Cuong Manh Le
parent 23e6ad6e1f
commit c329402f5d
4 changed files with 14 additions and 2 deletions

2
net.go
View File

@@ -18,6 +18,7 @@ const ipv6ProbingInterval = 10 * time.Second
func hasIPv6() bool {
hasIPv6Once.Do(func() {
Log(context.Background(), ProxyLogger.Load().Debug(), "checking for IPv6 availability once")
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
val := ctrldnet.IPv6Available(ctx)
@@ -43,6 +44,7 @@ func probingIPv6(ctx context.Context, old bool) {
if ipv6Available.CompareAndSwap(old, cur) {
old = cur
}
Log(ctx, ProxyLogger.Load().Debug(), "IPv6 availability: %v", cur)
}()
}
}