dns-configuration: add in_addr_union field to DNSServer type

This makes it easier to use DNSServer with helpers from in-addr-util.h.
This commit is contained in:
Nick Rosbrook
2026-02-03 15:07:41 -05:00
parent 8731d33b58
commit d9757721ab
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -58,6 +58,7 @@ static int dispatch_dns_server(const char *name, sd_json_variant *variant, sd_js
return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL),
"Dispatched address size (%zu) is incompatible with the family (%s).",
s->addr.iov_len, af_to_ipv4_ipv6(s->family));
memcpy_safe(&s->in_addr, s->addr.iov_base, s->addr.iov_len);
*ret = TAKE_PTR(s);
+2
View File
@@ -3,6 +3,7 @@
#include <sys/uio.h>
#include "in-addr-util.h"
#include "shared-forward.h"
typedef struct DNSServer {
@@ -12,6 +13,7 @@ typedef struct DNSServer {
int ifindex;
char *server_name;
bool accessible;
union in_addr_union in_addr;
} DNSServer;
DNSServer* dns_server_free(DNSServer *s);