From 99a884cb051f6256742da9a5bf35bbeb68a35744 Mon Sep 17 00:00:00 2001 From: Murtaza Aliakbar Date: Mon, 25 Nov 2024 02:51:12 +0530 Subject: [PATCH] lint: ipn/proxy, ipn/auto unused fns --- intra/ipn/auto.go | 7 +------ intra/ipn/proxy.go | 6 ------ 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/intra/ipn/auto.go b/intra/ipn/auto.go index af9b25b9..96fc99d5 100644 --- a/intra/ipn/auto.go +++ b/intra/ipn/auto.go @@ -10,7 +10,6 @@ import ( "context" "fmt" "net" - "strconv" "time" x "github.com/celzero/firestack/intra/backend" @@ -322,7 +321,7 @@ func (h *auto) dialIfReachable(p Proxy, network, local, remote string) (net.Conn // some IPs never respond to ping; ex: 34.245.245.138:443, 63.32.2.144:80 // even if they respond over tcp/udp on the same ip:port. // ipp, _ := netip.ParseAddrPort(remote) - // if reachable, err := h.ba.DoIt(baID(p, remote), icmpReachesWork(p, ipp)); err != nil { + // if reachable, err := h.ba.DoIt(p.ID()+remote, remote), icmpReachesWork(p, ipp)); err != nil { // return nil, fmt.Errorf("auto; %s ping %s: %v", p.ID(), remote, err) // } else if !reachable { // return nil, fmt.Errorf("auto; %s: %v: %s", p.ID(), errNoRouteToHost, remote) @@ -346,7 +345,3 @@ func maybeKeepAlive(c net.Conn) { core.SetKeepAliveConfigSockOpt(c) } } - -func baID(p Proxy, ipp string) string { - return strconv.Itoa(int(p.Handle())) + ipp -} diff --git a/intra/ipn/proxy.go b/intra/ipn/proxy.go index cacb80dc..f254205d 100644 --- a/intra/ipn/proxy.go +++ b/intra/ipn/proxy.go @@ -281,12 +281,6 @@ func icmpReachesWorkCtx(p Proxy, ipp netip.AddrPort) core.WorkCtx[bool] { } } -func icmpReachesWork(p Proxy, ipp netip.AddrPort) core.Work[bool] { - return func() (bool, error) { - return IcmpReaches(p, ipp) - } -} - func IcmpReaches(p Proxy, ipp netip.AddrPort) (bool, error) { if !ipp.IsValid() { return false, errInvalidAddr