WIP: rebase fork onto upstream/main (v1.103.0) #15

Closed
codinget wants to merge 670 commits from webnet into save/webnet-2026-07-29
4 changed files with 16 additions and 7 deletions
Showing only changes of commit 7b2432abae - Show all commits
+5 -1
View File
@@ -8609,7 +8609,7 @@ var ErrNoPreferredDERP = errors.New("no preferred DERP, try again later")
// suggestExitNodeLocked computes a suggestion based on the current netmap and
// other optional factors. If there are multiple equally good options, one may
// be selected at random, so the result is not stable. To be eligible for
// consideration, the peer must have NodeAttrSuggestExitNode in its CapMap.
// consideration, the peer must have [tailcfg.NodeAttrSuggestExitNode] in its CapMap.
//
// b.mu must be held.
func (b *LocalBackend) suggestExitNodeLocked() (response apitype.ExitNodeSuggestionResponse, err error) {
@@ -8641,6 +8641,10 @@ func (b *LocalBackend) suggestExitNodeLocked() (response apitype.ExitNodeSuggest
return res, err
}
// SuggestExitNode computes an exit-node suggestion based on the current netmap and
// other optional factors. If there are multiple equally good options, one may
// be selected at random, so the result is not stable. To be eligible for
// consideration, the peer must have [tailcfg.NodeAttrSuggestExitNode] in its CapMap.
func (b *LocalBackend) SuggestExitNode() (response apitype.ExitNodeSuggestionResponse, err error) {
if !buildfeatures.HasUseExitNode {
return response, feature.ErrUnavailable
+7 -2
View File
@@ -137,8 +137,13 @@ func (c *Client) probe(ctx context.Context, nodes iter.Seq[probed], limit int, t
metricPingError.Add(1)
return nil
default:
c.vlogf("ping %s (%s): result: %f ms (err: %v)",
n.addr, n.ID(), pong.LatencySeconds*1000, pong.Err)
if pong.Err != "" {
c.vlogf("ping %s (%s): result: %f ms (err: %v)",
n.addr, n.ID(), pong.LatencySeconds*1000, pong.Err)
} else {
c.vlogf("ping %s (%s): result: %f ms",
n.addr, n.ID(), pong.LatencySeconds*1000)
}
metricPingReachable.Add(1)
}
+1 -1
View File
@@ -26,7 +26,7 @@ var (
)
// Report returns the latest reachability report.
// Returns nil if a report isnt available, which happens during initialization.
// It returns nil if a report isnt available, which happens during initialization.
func (c *Client) Report() *Report {
metricReport.Add(1)
nm := c.nm.NetMapNoPeers()
+3 -3
View File
@@ -195,9 +195,9 @@ func (c *Client) Close() error {
return nil
}
ch := c.hasNetMap.Swap(nil) // clear before waking anything up
if ch != nil && *ch != nil {
close(*ch)
hasNetMap := c.hasNetMap.Swap(nil) // clear before waking anything up
if hasNetMap != nil && *hasNetMap != nil {
close(*hasNetMap) // wake waitForNetMap
}
return nil