Skip to content

Conversation

@k0ekk0ek
Copy link
Contributor

Initial (not very optimized) implementation of RFC9460. The SVCB RRTYPE is different from all other RRTYPEs in that it requires RDATA to be sorted (unless secondary, in which case we serve what we have). To avoid additional allocations, I've implemented a strict mode that moves existing RDATA out of the way, updates the maximum size, parses the RDATA for the parameter being parsed and move data that was already there to the right position. It's not "efficient", because we need to iterate the data in linear fashion, but since we're parsing we're already doing that. IMHO it's better than separate allocations and using qsort afterwards, although in NSD, that really makes more sense. Ideally, operators make sure the keys are in wire-format order, in which case it's way more efficient that doing separate allocations.

This does introduce the concept of rdata_t, sort-of an RDATA view. It's best if that concept is used by all other parse functions too. As we'll need to cleanup the API a little bit before the initial release, I'll add that later.

@k0ekk0ek k0ekk0ek merged commit 91bb96e into NLnetLabs:main Nov 23, 2023
@k0ekk0ek k0ekk0ek deleted the svcb-rr branch February 8, 2024 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant