mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-22 11:01:54 +00:00
ipn/ipnlocal: parse priority out of suggest-exit-node capability
When the `experimental:exit-node-steering` attribute is enabled for a node, it is likely that the priority score for an exit node is different when considering it as a suggested exit node versus considering it for the routers / connectors that it hosts. In order to distinguish between these two, the network map can now contain the priority score for suggesting the exit node in the `suggest-exit-node` capability, in that peer’s CapMap: "CapMap": { "suggest-exit-node": [ { "Priority": 42 } ] } Updates tailscale/corp#31011 Signed-off-by: Simon Law <sfllaw@tailscale.com>
This commit is contained in:
13
tailcfg/traffic.go
Normal file
13
tailcfg/traffic.go
Normal file
@@ -0,0 +1,13 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
package tailcfg
|
||||
|
||||
type SuggestExitNode struct {
|
||||
// Priority is the relative priority of this exit node. Nodes with a
|
||||
// higher priority are preferred over nodes with a lower priority, nodes
|
||||
// of equal probability may be selected arbitrarily. A priority of 0
|
||||
// means the exit node has no a priority preference and a negative
|
||||
// priority is not allowed.
|
||||
Priority int `json:",omitempty"`
|
||||
}
|
Reference in New Issue
Block a user