Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2023-07-26 11:53:42 +02:00 committed by Kristoffer Dalby
parent e55fe0671a
commit 13a7285658
8 changed files with 118 additions and 114 deletions

View file

@ -32,6 +32,8 @@ import (
const (
nextDNSDoHPrefix = "https://dns.nextdns.io"
reservedResponseHeaderSize = 4
mapperIDLength = 8
debugMapResponsePerm = 0o755
)
var debugDumpMapResponsePath = envknob.String("HEADSCALE_DEBUG_DUMP_MAPRESPONSE_PATH")
@ -72,7 +74,7 @@ func NewMapper(
Str("machine", machine.Hostname).
Msg("creating new mapper")
uid, _ := util.GenerateRandomStringDNSSafe(8)
uid, _ := util.GenerateRandomStringDNSSafe(mapperIDLength)
return &Mapper{
db: db,
@ -579,7 +581,7 @@ var zstdEncoderPool = &sync.Pool{
},
}
func (m *Mapper) baseMapResponse(machine *types.Machine) tailcfg.MapResponse {
func (m *Mapper) baseMapResponse(_ *types.Machine) tailcfg.MapResponse {
now := time.Now()
resp := tailcfg.MapResponse{