tailcfg: add peerRelay bool to hostinfo

This commit adds a bool named PeerRelay to Hostinfo, to identify the host's status of acting as a peer relay.
Considering the RelayServerPort number can be 0, I just made this a bool in stead of a port number. If the port
info is needed in future this would also help indicating if the port was set to 0 (meaning any port in peer relay
context).

Updates tailscale/corp#35862

Signed-off-by: KevinLiang10 <37811973+KevinLiang10@users.noreply.github.com>
This commit is contained in:
KevinLiang10
2026-02-04 10:30:07 -05:00
committed by Harry Harpham
parent 9ba2a80ab6
commit 5eaaf9786b
5 changed files with 21 additions and 0 deletions
+11
View File
@@ -67,6 +67,7 @@ func TestHostinfoEqual(t *testing.T) {
"UserspaceRouter",
"AppConnector",
"ServicesHash",
"PeerRelay",
"ExitNodeID",
"Location",
"TPM",
@@ -244,6 +245,16 @@ func TestHostinfoEqual(t *testing.T) {
&Hostinfo{AppConnector: opt.Bool("false")},
false,
},
{
&Hostinfo{PeerRelay: true},
&Hostinfo{PeerRelay: true},
true,
},
{
&Hostinfo{PeerRelay: true},
&Hostinfo{PeerRelay: false},
false,
},
{
&Hostinfo{ServicesHash: "73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049"},
&Hostinfo{ServicesHash: "73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049"},