Skip to content

Commit 2fa50ac

Browse files
committed
TUN-6384: Correct duplicate connection error to fetch new IP first
(cherry picked from commit 76add5c)
1 parent c7a6304 commit 2fa50ac

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

supervisor/tunnel.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,11 @@ type DefaultAddrFallback struct {
141141
func (f DefaultAddrFallback) ShouldGetNewAddress(err error) (needsNewAddress bool, isConnectivityError bool) {
142142
switch err.(type) {
143143
case nil: // maintain current IP address
144-
// Try the next address if it was a quic.IdleTimeoutError or
145-
// dupConnRegisterTunnelError
144+
// DupConnRegisterTunnelError should indicate to get a new address immediately
145+
case connection.DupConnRegisterTunnelError:
146+
return true, false
147+
// Try the next address if it was a quic.IdleTimeoutError
146148
case *quic.IdleTimeoutError,
147-
connection.DupConnRegisterTunnelError,
148149
edgediscovery.DialError,
149150
*connection.EdgeQuicDialError:
150151
// Wait for two failures before falling back to a new address

0 commit comments

Comments
 (0)