derp: plumb context to Server.verifyClient

Updates tailscale/corp#17693

Change-Id: If17e02c77d5ad86b820e639176da2d3e61296bae
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/11193/head
Brad Fitzpatrick 9 months ago committed by Brad Fitzpatrick
parent 7708ab68c0
commit 2988c1ec52

@ -691,7 +691,7 @@ func (s *Server) accept(ctx context.Context, nc Conn, brw *bufio.ReadWriter, rem
if err != nil { if err != nil {
return fmt.Errorf("receive client key: %v", err) 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) 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 { if !s.verifyClients {
return nil return nil
} }
status, err := tailscale.Status(context.TODO()) status, err := tailscale.Status(ctx)
if err != nil { if err != nil {
return fmt.Errorf("failed to query local tailscaled status: %w", err) return fmt.Errorf("failed to query local tailscaled status: %w", err)
} }

Loading…
Cancel
Save