derp: plumb context to Server.verifyClient

Updates tailscale/corp#17693

Change-Id: If17e02c77d5ad86b820e639176da2d3e61296bae
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2024-02-21 16:18:05 -08:00 committed by Brad Fitzpatrick
parent 7708ab68c0
commit 2988c1ec52
1 changed files with 3 additions and 3 deletions

View File

@ -691,7 +691,7 @@ func (s *Server) accept(ctx context.Context, nc Conn, brw *bufio.ReadWriter, rem
if err != nil {
return fmt.Errorf("receive client key: %v", err)
}
if err := s.verifyClient(clientKey, clientInfo); err != nil {
if err := s.verifyClient(ctx, clientKey, clientInfo); err != nil {
return fmt.Errorf("client %x rejected: %v", clientKey, err)
}
@ -1116,11 +1116,11 @@ func (c *sclient) requestMeshUpdate() {
}
}
func (s *Server) verifyClient(clientKey key.NodePublic, info *clientInfo) error {
func (s *Server) verifyClient(ctx context.Context, clientKey key.NodePublic, info *clientInfo) error {
if !s.verifyClients {
return nil
}
status, err := tailscale.Status(context.TODO())
status, err := tailscale.Status(ctx)
if err != nil {
return fmt.Errorf("failed to query local tailscaled status: %w", err)
}