From 2988c1ec522b4b0302ab7db7446c90af5197bdc8 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 21 Feb 2024 16:18:05 -0800 Subject: [PATCH] derp: plumb context to Server.verifyClient Updates tailscale/corp#17693 Change-Id: If17e02c77d5ad86b820e639176da2d3e61296bae Signed-off-by: Brad Fitzpatrick --- derp/derp_server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/derp/derp_server.go b/derp/derp_server.go index 866582b7c..b36669c8c 100644 --- a/derp/derp_server.go +++ b/derp/derp_server.go @@ -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) }