TUN-6384: Correct duplicate connection error to fetch new IP first

(cherry picked from commit 76add5ca77)
This commit is contained in:
Devin Carr 2022-06-13 10:36:40 -07:00
parent c7a6304d32
commit 2fa50acc2d
1 changed files with 4 additions and 3 deletions

View File

@ -141,10 +141,11 @@ type DefaultAddrFallback struct {
func (f DefaultAddrFallback) ShouldGetNewAddress(err error) (needsNewAddress bool, isConnectivityError bool) { func (f DefaultAddrFallback) ShouldGetNewAddress(err error) (needsNewAddress bool, isConnectivityError bool) {
switch err.(type) { switch err.(type) {
case nil: // maintain current IP address case nil: // maintain current IP address
// Try the next address if it was a quic.IdleTimeoutError or // DupConnRegisterTunnelError should indicate to get a new address immediately
// dupConnRegisterTunnelError case connection.DupConnRegisterTunnelError:
return true, false
// Try the next address if it was a quic.IdleTimeoutError
case *quic.IdleTimeoutError, case *quic.IdleTimeoutError,
connection.DupConnRegisterTunnelError,
edgediscovery.DialError, edgediscovery.DialError,
*connection.EdgeQuicDialError: *connection.EdgeQuicDialError:
// Wait for two failures before falling back to a new address // Wait for two failures before falling back to a new address