dnsdist: Fix a bug in SetEDNSOptionAction
Short description
The DNS parser has already converted the "TTL" of the OPT record to the host byte order before providing to us, and unfortunately we do not want that for the meta-OPT record, where the TTL is used to encode the extended rcode, the EDNS version and the DO bits, amongst other things. In other places we do parse the TTL from the DNS payload ourselves and thus do not need to worry about that conversion, but here we need to convert the value back to the network byte order.
Fixes #11728.
This PR needs unit and regression tests before being merged.
Checklist
I have:
- [x] read the CONTRIBUTING.md document
- [x] compiled this code
- [x] tested this code
- [ ] included documentation (including possible behaviour changes)
- [ ] documented the code
- [ ] added or modified regression test(s)
- [ ] added or modified unit test(s)
I just pushed unit and regression tests, plus a new DNSQuestion:setEDNSOption() binding which is usable from a Lua function.
The current approach does not link, I will have to do things differently:
- move the code dealing with the EDNS option to a different function in a different file
- call that function from the Lua action and DNSQuestion method
Finally found the time to do that, this PR should now be ready for review.