net/dnscache: run happy eyeballs with more than one dest IP (#19770)
If the context given to DialContext has a shorter lifetime than the OS TCP SYN timeout, and TCP SYNs are dropped from the path to the remote, DialContext would never fall back to try IPv6 after IPv4. Instead, use the normal happy eyeballs race if there is more than one address. This does remove the implicit prioritization of IPv4 over IPv6 in cases where there is only a single IPv4 remote address. Updates #13346 Signed-off-by: Claus Lensbøl <claus@tailscale.com>
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
package vmtest_test
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
@@ -13,8 +12,6 @@ import (
|
||||
"tailscale.com/tstest/natlab/vnet"
|
||||
)
|
||||
|
||||
var knownBroken = flag.Bool("known-broken", false, "run known-broken tests")
|
||||
|
||||
func v6cidr(n int) string {
|
||||
return fmt.Sprintf("2000:%d::1/64", n)
|
||||
}
|
||||
@@ -228,12 +225,7 @@ func TestSingleJustIPv6(t *testing.T) {
|
||||
|
||||
// TestSingleDualBrokenIPv4 tests a dual-stack node with broken
|
||||
// (blackholed) IPv4.
|
||||
//
|
||||
// See https://github.com/tailscale/tailscale/issues/13346
|
||||
func TestSingleDualBrokenIPv4(t *testing.T) {
|
||||
if !*knownBroken {
|
||||
t.Skip("skipping known-broken test; set --known-broken to run; see https://github.com/tailscale/tailscale/issues/13346")
|
||||
}
|
||||
env := vmtest.New(t)
|
||||
v6AndBlackholedIPv4(env)
|
||||
env.Start()
|
||||
|
||||
Reference in New Issue
Block a user