<term><varname>DNS=</varname></term>
<listitem>
<para>A DNS server address, which must be in the format described in
- <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>
- .</para>
+ <citerefentry><refentrytitle>inet_pton</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
+ This option may be specified repeatedly.</para>
</listitem>
</varlistentry>
<varlistentry>
const char *rvalue,
void *data,
void *userdata) {
- Address **dns = data;
+ Set **dns = data;
_cleanup_address_free_ Address *n = NULL;
int r;
return 0;
}
- *dns = n;
+ set_put(*dns, n);
n = NULL;
return 0;
}
}
- HASHMAP_FOREACH(link, m->links, i)
- if (link->network && link->network->dns)
- append_dns(f, &link->network->dns->in_addr.in,
- link->network->dns->family, &count);
+ HASHMAP_FOREACH(link, m->links, i) {
+ if (link->network && link->network->dns) {
+ Address *address;
+ Iterator j;
+
+ SET_FOREACH(address, link->network->dns, j) {
+ append_dns(f, &address->in_addr.in,
+ address->family, &count);
+ }
+ }
+ }
fflush(f);
if (!network->routes_by_section)
return log_oom();
+ network->dns = set_new(NULL, NULL);
+ if (!network->dns)
+ return log_oom();
+
network->filename = strdup(filename);
if (!network->filename)
return log_oom();
void network_free(Network *network) {
Route *route;
Address *address;
+ Iterator i;
if (!network)
return;
free(network->description);
- address_free(network->dns);
+ SET_FOREACH(address, network->dns, i)
+ address_free(address);
+
+ set_free(network->dns);
hashmap_free(network->vlans);
#include "rtnl-util.h"
#include "hashmap.h"
#include "list.h"
+#include "set.h"
#include "condition-util.h"
typedef struct NetDev NetDev;
LIST_HEAD(Address, static_addresses);
LIST_HEAD(Route, static_routes);
- Address *dns;
Hashmap *addresses_by_section;
Hashmap *routes_by_section;
+ Set *dns;
+
LIST_FIELDS(Network, networks);
};