diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2017-07-06 09:41:10 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2017-09-13 15:34:22 +0200 |
commit | 028ab85da8ef40af43aeb48129ffa32c98503336 (patch) | |
tree | e11ae9a7210e1fb0a1c37763668b5810fbfa6cb4 /src/config.c | |
parent | a827fcad451996f1a7043b479d8c6162174b2038 (diff) |
dhcpv4: force renew nonce authentication support
Support force renew nonce authentication support in the DHCPv4 server as
described in RFC3203 and RFC6704.
The interface uci arameter dhcpv4_forcereconf allows to supports DHCPv4
clients which support force renew without authentication.
While at it align network byte order logic for simplicity.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c index e79f9ce..2c35aab 100644 --- a/src/config.c +++ b/src/config.c @@ -42,6 +42,7 @@ enum { IFACE_ATTR_DNS, IFACE_ATTR_DOMAIN, IFACE_ATTR_FILTER_CLASS, + IFACE_ATTR_DHCPV4_FORCERECONF, IFACE_ATTR_DHCPV6_RAW, IFACE_ATTR_DHCPV6_ASSIGNALL, IFACE_ATTR_RA_DEFAULT, @@ -83,6 +84,7 @@ static const struct blobmsg_policy iface_attrs[IFACE_ATTR_MAX] = { [IFACE_ATTR_DNS] = { .name = "dns", .type = BLOBMSG_TYPE_ARRAY }, [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_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 }, @@ -621,6 +623,9 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr memcpy(iface->filter_class, blobmsg_get_string(c), blobmsg_data_len(c) + 1); } + if ((c = tb[IFACE_ATTR_DHCPV4_FORCERECONF])) + iface->dhcpv4_forcereconf = blobmsg_get_bool(c); + if ((c = tb[IFACE_ATTR_DHCPV6_RAW])) { iface->dhcpv6_raw_len = blobmsg_data_len(c) / 2; iface->dhcpv6_raw = realloc(iface->dhcpv6_raw, iface->dhcpv6_raw_len); |