From cdd91f51323dce685eb2b5236c2a1cc298418f51 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Sun, 26 Feb 2023 10:10:38 +0800 Subject: [PATCH] chore: remove unsed code --- component/dialer/dialer.go | 8 +------- hub/executor/executor.go | 6 +----- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/component/dialer/dialer.go b/component/dialer/dialer.go index 2a54536b..e6e8edc9 100644 --- a/component/dialer/dialer.go +++ b/component/dialer/dialer.go @@ -17,9 +17,7 @@ var ( actualSingleStackDialContext = serialSingleStackDialContext actualDualStackDialContext = serialDualStackDialContext tcpConcurrent = false - DisableIPv6 = false ErrorInvalidedNetworkStack = errors.New("invalided network stack") - ErrorDisableIPv6 = errors.New("IPv6 is disabled, dialer cancel") ErrorConnTimeout = errors.New("connect timeout") ) @@ -113,10 +111,6 @@ func dialContext(ctx context.Context, network string, destination netip.Addr, po bindMarkToDialer(opt.routingMark, dialer, network, destination) } - if DisableIPv6 && destination.Is6() { - return nil, ErrorDisableIPv6 - } - address := net.JoinHostPort(destination.String(), port) if opt.tfo { return dialTFO(ctx, *dialer, network, address) @@ -296,7 +290,7 @@ type dialResult struct { isPrimary bool } -func parseAddr(ctx context.Context, network,address string, preferResolver resolver.Resolver) ([]netip.Addr, string, error) { +func parseAddr(ctx context.Context, network, address string, preferResolver resolver.Resolver) ([]netip.Addr, string, error) { host, port, err := net.SplitHostPort(address) if err != nil { return nil, "-1", err diff --git a/hub/executor/executor.go b/hub/executor/executor.go index 34f0f1a1..c55201cd 100644 --- a/hub/executor/executor.go +++ b/hub/executor/executor.go @@ -331,11 +331,7 @@ func updateTunnels(tunnels []LC.Tunnel) { func updateGeneral(general *config.General) { tunnel.SetMode(general.Mode) tunnel.SetFindProcessMode(general.FindProcessMode) - dialer.DisableIPv6 = !general.IPv6 - if !dialer.DisableIPv6 { - log.Infoln("Use IPv6") - } - resolver.DisableIPv6 = dialer.DisableIPv6 + resolver.DisableIPv6 =!general.IPv6 if general.TCPConcurrent { dialer.SetDial(general.TCPConcurrent)