diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2018-12-31 17:06:40 +0100 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2019-01-01 13:53:34 +0100 |
commit | 5e997388ba19e84764601d147ffb3bfb6cc455d1 (patch) | |
tree | 3aeb0773bdfb822174332c1ac02c1885cf291513 /src/config.c | |
parent | 1fe77f3f40cbe9227ade848e7c95f6354b2ff409 (diff) |
router: make announcing DNS info configurable (FS#2020)
Make announcing options Recursive DNS server and DNS search list
configurable via the ra_dns config option.
This allows to disable sending RA based DNS info if such info is
already provided by DHCPv6.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c index 9ffe1ac..29d7181 100644 --- a/src/config.c +++ b/src/config.c @@ -58,6 +58,7 @@ enum { IFACE_ATTR_RA_RETRANSTIME, IFACE_ATTR_RA_HOPLIMIT, IFACE_ATTR_RA_MTU, + IFACE_ATTR_RA_DNS, IFACE_ATTR_PD_MANAGER, IFACE_ATTR_PD_CER, IFACE_ATTR_NDPROXY_ROUTING, @@ -103,6 +104,7 @@ static const struct blobmsg_policy iface_attrs[IFACE_ATTR_MAX] = { [IFACE_ATTR_RA_RETRANSTIME] = { .name = "ra_retranstime", .type = BLOBMSG_TYPE_INT32 }, [IFACE_ATTR_RA_HOPLIMIT] = { .name = "ra_hoplimit", .type = BLOBMSG_TYPE_INT32 }, [IFACE_ATTR_RA_MTU] = { .name = "ra_mtu", .type = BLOBMSG_TYPE_INT32 }, + [IFACE_ATTR_RA_DNS] = { .name = "ra_dns", .type = BLOBMSG_TYPE_BOOL }, [IFACE_ATTR_NDPROXY_ROUTING] = { .name = "ndproxy_routing", .type = BLOBMSG_TYPE_BOOL }, [IFACE_ATTR_NDPROXY_SLAVE] = { .name = "ndproxy_slave", .type = BLOBMSG_TYPE_BOOL }, [IFACE_ATTR_PREFIX_FILTER] = { .name = "prefix_filter", .type = BLOBMSG_TYPE_STRING }, @@ -218,6 +220,7 @@ static void set_interface_defaults(struct interface *iface) iface->ra_maxinterval = 600; iface->ra_mininterval = iface->ra_maxinterval/3; iface->ra_lifetime = -1; + iface->ra_dns = true; } static void clean_interface(struct interface *iface) @@ -704,6 +707,9 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr if ((c = tb[IFACE_ATTR_RA_USELEASETIME])) iface->ra_useleasetime = blobmsg_get_bool(c); + if ((c = tb[IFACE_ATTR_RA_DNS])) + iface->ra_dns = blobmsg_get_bool(c); + if ((c = tb[IFACE_ATTR_RA_PREFERENCE])) { const char *prio = blobmsg_get_string(c); |