mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-21 18:42:36 +00:00
tailcfg: add Hostinfo.ExitNodeID to report the selected exit node (#16625)
When a client selects a particular exit node, Control may use that as a signal for deciding other routes. This patch causes the client to report whenever the current exit node changes, through tailcfg.Hostinfo.ExitNodeID. It relies on a properly set ipn.Prefs.ExitNodeID, which should already be resolved by `tailscale set`. Updates tailscale/corp#30536 Signed-off-by: Simon Law <sfllaw@tailscale.com>
This commit is contained in:
@@ -67,6 +67,7 @@ func TestHostinfoEqual(t *testing.T) {
|
||||
"UserspaceRouter",
|
||||
"AppConnector",
|
||||
"ServicesHash",
|
||||
"ExitNodeID",
|
||||
"Location",
|
||||
"TPM",
|
||||
"StateEncrypted",
|
||||
@@ -273,6 +274,21 @@ func TestHostinfoEqual(t *testing.T) {
|
||||
&Hostinfo{IngressEnabled: true},
|
||||
false,
|
||||
},
|
||||
{
|
||||
&Hostinfo{ExitNodeID: "stable-exit"},
|
||||
&Hostinfo{ExitNodeID: "stable-exit"},
|
||||
true,
|
||||
},
|
||||
{
|
||||
&Hostinfo{ExitNodeID: ""},
|
||||
&Hostinfo{},
|
||||
true,
|
||||
},
|
||||
{
|
||||
&Hostinfo{ExitNodeID: ""},
|
||||
&Hostinfo{ExitNodeID: "stable-exit"},
|
||||
false,
|
||||
},
|
||||
}
|
||||
for i, tt := range tests {
|
||||
got := tt.a.Equal(tt.b)
|
||||
|
Reference in New Issue
Block a user