Skip to content

Commit

Permalink
lint: ipn/proxy, ipn/auto unused fns
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Nov 24, 2024
1 parent da019fb commit 99a884c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
7 changes: 1 addition & 6 deletions intra/ipn/auto.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"context"
"fmt"
"net"
"strconv"
"time"

x "github.com/celzero/firestack/intra/backend"
Expand Down Expand Up @@ -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)
Expand All @@ -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
}
6 changes: 0 additions & 6 deletions intra/ipn/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 99a884c

Please sign in to comment.