Upgrade Go 1.21, Tailscale 1.50 and add Capability version support (#1563)

This commit is contained in:
Kristoffer Dalby 2023-09-28 12:33:53 -07:00 committed by GitHub
parent 01b85e5232
commit fb4ed95ff6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 277 additions and 132 deletions

View file

@ -75,5 +75,18 @@ func (ns *noiseServer) NoisePollNetMapHandler(
Str("node", node.Hostname).
Msg("A node sending a MapRequest with Noise protocol")
ns.headscale.handlePoll(writer, req.Context(), node, mapRequest, true)
capVer, err := parseCabailityVersion(req)
if err != nil && !errors.Is(err, ErrNoCapabilityVersion) {
log.Error().
Caller().
Err(err).
Msg("failed to parse capVer")
http.Error(writer, "Internal error", http.StatusInternalServerError)
return
}
// TODO(kradalby): since we are now passing capVer, we could arguably stop passing
// isNoise, and rather have a isNoise function that takes capVer
ns.headscale.handlePoll(writer, req.Context(), node, mapRequest, true, capVer)
}