summaryrefslogtreecommitdiffhomepage
path: root/src/config.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2017-08-02 22:32:08 +0200
committerHans Dedecker <dedeckeh@gmail.com>2017-08-03 18:37:47 +0200
commit296b4a0ddd7d6d77e48ee36f3407b0769caaa0d7 (patch)
tree030b111f4fde71b389e22b6a5478d0c6e117bb54 /src/config.c
parentf4d38e0a853e933a4da54fde8ec2711b5dc5b741 (diff)
dhcpv6: assign all viable DHCPv6 addresses by default (FS#402, FS#524)
Some client implementations expect DHCPv6 addresses to be assigned for every prefix present in a RA as reported in FS#524; if not done the client implementations spam the DHCPv6 server with SOLICIT messages trying to get an DHCPv6 address for every prefix. When ra_managed is set to 1 and an ULA prefix is configured; the DHCPv6 server will only assign an ULA DHCPv6 addresses which possibly leads to DNS issues. Fix these problems by providing dhcpv6_assignall config option which assigns all viable DHCPv6 addresses to a client by default. This is a trade off as it means client implementations will be assigned more IPv6 addresses and lose the ability to quickly renumber clients which don't support reconfigure accept in case of wan prefix change Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c
index 8670efc..19b901c 100644
--- a/src/config.c
+++ b/src/config.c
@@ -43,6 +43,7 @@ enum {
IFACE_ATTR_DOMAIN,
IFACE_ATTR_FILTER_CLASS,
IFACE_ATTR_DHCPV6_RAW,
+ IFACE_ATTR_DHCPV6_ASSIGNALL,
IFACE_ATTR_RA_DEFAULT,
IFACE_ATTR_RA_MANAGEMENT,
IFACE_ATTR_RA_OFFLINK,
@@ -83,6 +84,7 @@ static const struct blobmsg_policy iface_attrs[IFACE_ATTR_MAX] = {
[IFACE_ATTR_DOMAIN] = { .name = "domain", .type = BLOBMSG_TYPE_ARRAY },
[IFACE_ATTR_FILTER_CLASS] = { .name = "filter_class", .type = BLOBMSG_TYPE_STRING },
[IFACE_ATTR_DHCPV6_RAW] = { .name = "dhcpv6_raw", .type = BLOBMSG_TYPE_STRING },
+ [IFACE_ATTR_DHCPV6_ASSIGNALL] = { .name ="dhcpv6_assignall", .type = BLOBMSG_TYPE_BOOL },
[IFACE_ATTR_PD_MANAGER] = { .name = "pd_manager", .type = BLOBMSG_TYPE_STRING },
[IFACE_ATTR_PD_CER] = { .name = "pd_cer", .type = BLOBMSG_TYPE_STRING },
[IFACE_ATTR_RA_DEFAULT] = { .name = "ra_default", .type = BLOBMSG_TYPE_INT32 },
@@ -205,9 +207,10 @@ static struct interface* get_interface(const char *name)
static void set_interface_defaults(struct interface *iface)
{
- iface->ra_managed = RA_MANAGED_MFLAG;
iface->learn_routes = 1;
iface->dhcpv4_leasetime = 43200;
+ iface->dhcpv6_assignall = true;
+ iface->ra_managed = RA_MANAGED_MFLAG;
iface->ra_maxinterval = 600;
iface->ra_mininterval = iface->ra_maxinterval/3;
iface->ra_lifetime = -1;
@@ -617,6 +620,9 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
odhcpd_unhexlify(iface->dhcpv6_raw, iface->dhcpv6_raw_len, blobmsg_get_string(c));
}
+ if ((c = tb[IFACE_ATTR_DHCPV6_ASSIGNALL]))
+ iface->dhcpv6_assignall = blobmsg_get_bool(c);
+
if ((c = tb[IFACE_ATTR_RA_DEFAULT]))
iface->default_router = blobmsg_get_u32(c);