accepts IPv4 only
dns list <local address> DNS servers to announce
accepts IPv4 and IPv6
+dns_service bool 1 Announce the address of interface as DNS service
+ if the list of dns is empty
domain list <local search domain> Search domains to announce
leasetime string 12h DHCPv4 address leasetime
IFACE_ATTR_NDP,
IFACE_ATTR_ROUTER,
IFACE_ATTR_DNS,
+ IFACE_ATTR_DNS_SERVICE,
IFACE_ATTR_DOMAIN,
IFACE_ATTR_FILTER_CLASS,
IFACE_ATTR_DHCPV4_FORCERECONF,
[IFACE_ATTR_NDP] = { .name = "ndp", .type = BLOBMSG_TYPE_STRING },
[IFACE_ATTR_ROUTER] = { .name = "router", .type = BLOBMSG_TYPE_ARRAY },
[IFACE_ATTR_DNS] = { .name = "dns", .type = BLOBMSG_TYPE_ARRAY },
+ [IFACE_ATTR_DNS_SERVICE] = { .name = "dns_service", .type = BLOBMSG_TYPE_BOOL },
[IFACE_ATTR_DOMAIN] = { .name = "domain", .type = BLOBMSG_TYPE_ARRAY },
[IFACE_ATTR_FILTER_CLASS] = { .name = "filter_class", .type = BLOBMSG_TYPE_STRING },
[IFACE_ATTR_DHCPV4_FORCERECONF] = { .name = "dhcpv4_forcereconf", .type = BLOBMSG_TYPE_BOOL },
iface->dhcpv6_assignall = true;
iface->dhcpv6_pd = true;
iface->dhcpv6_na = true;
+ iface->dns_service = true;
iface->ra_flags = ND_RA_FLAG_OTHER;
iface->ra_slaac = true;
iface->ra_maxinterval = 600;
}
}
+ if ((c = tb[IFACE_ATTR_DNS_SERVICE]))
+ iface->dns_service = blobmsg_get_bool(c);
+
if ((c = tb[IFACE_ATTR_DOMAIN])) {
struct blob_attr *cur;
unsigned rem;
4 * iface->dhcpv4_router_cnt, iface->dhcpv4_router);
- if (iface->dhcpv4_dns_cnt == 0)
- dhcpv4_put(&reply, &cookie, DHCPV4_OPT_DNSSERVER, 4, &iface->dhcpv4_local);
- else
+ if (iface->dhcpv4_dns_cnt == 0) {
+ if (iface->dns_service)
+ dhcpv4_put(&reply, &cookie, DHCPV4_OPT_DNSSERVER, 4, &iface->dhcpv4_local);
+ } else
dhcpv4_put(&reply, &cookie, DHCPV4_OPT_DNSSERVER,
4 * iface->dhcpv4_dns_cnt, iface->dhcpv4_dns);
time_t now = odhcpd_time();
ssize_t m = -1;
+ if (!iface->dns_service)
+ return -1;
+
for (size_t i = 0; i < iface->addr6_len; ++i) {
if (iface->addr6[i].valid <= (uint32_t)now)
continue;