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:
committed by
Harry Harpham
parent
9ba2a80ab6
commit
5eaaf9786b
@@ -5671,6 +5671,10 @@ func (b *LocalBackend) applyPrefsToHostinfoLocked(hi *tailcfg.Hostinfo, prefs ip
|
||||
}
|
||||
hi.SSH_HostKeys = sshHostKeys
|
||||
|
||||
if buildfeatures.HasRelayServer {
|
||||
hi.PeerRelay = prefs.RelayServerPort().Valid()
|
||||
}
|
||||
|
||||
for _, f := range hookMaybeMutateHostinfoLocked {
|
||||
f(b, hi, prefs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user