From 4b39b6f7ceed7ac640f5231a56bb56dad3e01850 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 19 Jun 2024 08:13:36 -0700 Subject: [PATCH] derp: fix fmt verb for nodekeys It was hex-ifying the String() form of key.NodePublic, which was already hex. I noticed in some logs: "client 6e6f64656b65793a353537353..." And thought that 6x6x6x6x looked strange. It's "nodekey:" in hex. Updates tailscale/corp#20844 Change-Id: Ib9f2d63b37e324420b86efaa680668a9b807e465 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 eb4528e72..889bede9d 100644 --- a/derp/derp_server.go +++ b/derp/derp_server.go @@ -725,7 +725,7 @@ func (s *Server) accept(ctx context.Context, nc Conn, brw *bufio.ReadWriter, rem clientAP, _ := netip.ParseAddrPort(remoteAddr) if err := s.verifyClient(ctx, clientKey, clientInfo, clientAP.Addr()); err != nil { - return fmt.Errorf("client %x rejected: %v", clientKey, err) + return fmt.Errorf("client %v rejected: %v", clientKey, err) } // At this point we trust the client so we don't time out. @@ -939,7 +939,7 @@ func (c *sclient) handleFrameForwardPacket(ft frameType, fl uint32) error { srcKey, dstKey, contents, err := s.recvForwardPacket(c.br, fl) if err != nil { - return fmt.Errorf("client %x: recvForwardPacket: %v", c.key, err) + return fmt.Errorf("client %v: recvForwardPacket: %v", c.key, err) } s.packetsForwardedIn.Add(1) @@ -994,7 +994,7 @@ func (c *sclient) handleFrameSendPacket(ft frameType, fl uint32) error { dstKey, contents, err := s.recvPacket(c.br, fl) if err != nil { - return fmt.Errorf("client %x: recvPacket: %v", c.key, err) + return fmt.Errorf("client %v: recvPacket: %v", c.key, err) } var fwd PacketForwarder