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:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user