mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-02 18:11:59 +00:00
derp, wgengine/magicsock: support more than just packets from Client.Recv
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
88f1cc0c98
commit
379a3125fd
@@ -328,8 +328,8 @@ func (s *Server) recvPacket(ctx context.Context, br *bufio.Reader, frameLen uint
|
||||
return key.Public{}, nil, err
|
||||
}
|
||||
packetLen := frameLen - keyLen
|
||||
if packetLen > maxPacketData {
|
||||
return key.Public{}, nil, fmt.Errorf("data packet longer (%d) than max of %v", packetLen, maxPacketData)
|
||||
if packetLen > MaxPacketSize {
|
||||
return key.Public{}, nil, fmt.Errorf("data packet longer (%d) than max of %v", packetLen, MaxPacketSize)
|
||||
}
|
||||
if err := limiter.WaitN(ctx, int(packetLen)); err != nil {
|
||||
return key.Public{}, nil, fmt.Errorf("rate limit: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user