mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 20:59:58 +00:00
TUN-6595: Enable datagramv2 and icmp proxy by default
This commit is contained in:

committed by
Chung-Ting Huang

parent
b1995b4dd1
commit
3d345d3748
@@ -116,14 +116,12 @@ func NewSupervisor(config *TunnelConfig, orchestrator *orchestration.Orchestrato
|
||||
gracefulShutdownC: gracefulShutdownC,
|
||||
connAwareLogger: log,
|
||||
}
|
||||
if useDatagramV2(config) {
|
||||
// TODO: TUN-6701: Decouple upgrade of datagram v2 and using icmp proxy
|
||||
icmpRouter, err := ingress.NewICMPRouter(config.Log)
|
||||
if err != nil {
|
||||
log.Logger().Warn().Err(err).Msg("Failed to create icmp router, will continue to use datagram v1")
|
||||
} else {
|
||||
edgeTunnelServer.icmpRouter = icmpRouter
|
||||
}
|
||||
|
||||
icmpRouter, err := ingress.NewICMPRouter(config.Log)
|
||||
if err != nil {
|
||||
log.Logger().Warn().Err(err).Msg("Failed to create icmp router, ICMP proxy feature is disabled")
|
||||
} else {
|
||||
edgeTunnelServer.icmpRouter = icmpRouter
|
||||
}
|
||||
|
||||
useReconnectToken := false
|
||||
@@ -435,15 +433,3 @@ func (s *Supervisor) authenticate(ctx context.Context, numPreviousAttempts int)
|
||||
registrationOptions.NumPreviousAttempts = uint8(numPreviousAttempts)
|
||||
return rpcClient.Authenticate(ctx, s.config.ClassicTunnel, registrationOptions)
|
||||
}
|
||||
|
||||
func useDatagramV2(config *TunnelConfig) bool {
|
||||
if config.NamedTunnel == nil {
|
||||
return false
|
||||
}
|
||||
for _, feature := range config.NamedTunnel.Client.Features {
|
||||
if feature == FeatureDatagramV2 {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user