cmd/stunstamp: use measureFn more consistently in naming/signatures (#13360)

Updates #cleanup

Signed-off-by: Jordan Whited <jordan@tailscale.com>
pull/13362/head
Jordan Whited 3 months ago committed by GitHub
parent 6d6b1773ea
commit 1dd1798bfa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -499,7 +499,7 @@ func newConnAndMeasureFn(forDst netip.Addr, source timestampSource, protocol pro
} }
return &connAndMeasureFn{ return &connAndMeasureFn{
conn: conn, conn: conn,
fn: mkICMPRTTFn(source), fn: mkICMPMeasureFn(source),
}, nil }, nil
case protocolHTTPS: case protocolHTTPS:
localPort := 0 localPort := 0

@ -54,7 +54,7 @@ func getICMPConn(forDst netip.Addr, source timestampSource) (io.ReadWriteCloser,
return nil, errors.New("platform unsupported") return nil, errors.New("platform unsupported")
} }
func mkICMPRTTFn(source timestampSource) func(conn io.ReadWriteCloser, hostname string, dst netip.AddrPort) (rtt time.Duration, err error) { func mkICMPMeasureFn(source timestampSource) measureFn {
return func(conn io.ReadWriteCloser, hostname string, dst netip.AddrPort) (rtt time.Duration, err error) { return func(conn io.ReadWriteCloser, hostname string, dst netip.AddrPort) (rtt time.Duration, err error) {
return 0, errors.New("platform unsupported") return 0, errors.New("platform unsupported")
} }

@ -62,7 +62,7 @@ func parseTimestampFromCmsgs(oob []byte) (time.Time, error) {
return time.Time{}, errors.New("failed to parse timestamp from cmsgs") return time.Time{}, errors.New("failed to parse timestamp from cmsgs")
} }
func mkICMPRTTFn(source timestampSource) func(conn io.ReadWriteCloser, hostname string, dst netip.AddrPort) (rtt time.Duration, err error) { func mkICMPMeasureFn(source timestampSource) measureFn {
return func(conn io.ReadWriteCloser, hostname string, dst netip.AddrPort) (rtt time.Duration, err error) { return func(conn io.ReadWriteCloser, hostname string, dst netip.AddrPort) (rtt time.Duration, err error) {
return measureICMPRTT(source, conn, hostname, dst) return measureICMPRTT(source, conn, hostname, dst)
} }

Loading…
Cancel
Save