mbox series

[0/3] keyutils: create a common DNS interface

Message ID 20220707191507.2013-1-ematsumiya@suse.de (mailing list archive)
Headers show
Series keyutils: create a common DNS interface | expand

Message

Enzo Matsumiya July 7, 2022, 7:15 p.m. UTC
Hi David, list,

In the following patches, I moved all the common DNS functionality in
keyutils into key.dns.{h,c} with the aim to:

- Improve code readability
- ... by restructuring the DNS functions
- Use libresolv for any query, and not only AFSDB/SRV types. This allows
  A/AAAA queries to also have extra data fetched (such as TTL, for example)
- Add flexibility to add/remove/update any DNS query type

Patch 1/3: moves the common DNS parts into key.dns.{h.c}, rework on the
	   query part to have it as generic as possible, adapt callers
	   to the new structure.
Patch 2/3: refactor read_config() to make it more structured, hence more
	   flexible (idea is to have it ready for new config options).
Patch 3/3: adds a "ns=ADDR" callout option to allow callers to specify
	   custom nameservers for their queries. Custom as in, different
	   from the system's default (usually resolv.conf).

I've been using most of this code on my day-to-day to aid my
CIFS debugging activities and I thought it'd be good to have it
upstream.

Reviews, feedback, testing are all welcome.


Cheers,

Enzo Matsumiya (3):
  key.dns: create a common DNS interface
  key.dns_resolver: refactor read_config()
  key.dns: allow to use custom nameservers

 Makefile           |   6 +-
 dns.afsdb.c        | 358 +++++-------------
 key.dns.c          | 891 +++++++++++++++++++++++++++++++++++++++++++++
 key.dns.h          | 260 +++++++++++--
 key.dns_resolver.c | 683 +++++++++++++---------------------
 5 files changed, 1457 insertions(+), 741 deletions(-)
 create mode 100644 key.dns.c