summaryrefslogtreecommitdiffhomepage
path: root/src/ubus.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2017-07-06 09:41:10 +0200
committerHans Dedecker <dedeckeh@gmail.com>2017-09-13 15:34:22 +0200
commit028ab85da8ef40af43aeb48129ffa32c98503336 (patch)
treee11ae9a7210e1fb0a1c37763668b5810fbfa6cb4 /src/ubus.c
parenta827fcad451996f1a7043b479d8c6162174b2038 (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/ubus.c')
-rw-r--r--src/ubus.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ubus.c b/src/ubus.c
index 2ffa4e3..6fbb98f 100644
--- a/src/ubus.c
+++ b/src/ubus.c
@@ -45,6 +45,7 @@ static int handle_dhcpv4_leases(struct ubus_context *ctx, _unused struct ubus_ob
blobmsg_add_string_buffer(&b);
blobmsg_add_string(&b, "hostname", (c->hostname) ? c->hostname : "");
+ blobmsg_add_u8(&b, "accept-reconf-nonce", c->accept_fr_nonce);
m = blobmsg_open_array(&b, "flags");
if (c->flags & OAF_BOUND)
@@ -55,7 +56,7 @@ static int handle_dhcpv4_leases(struct ubus_context *ctx, _unused struct ubus_ob
blobmsg_close_array(&b, m);
buf = blobmsg_alloc_string_buffer(&b, "ip", INET_ADDRSTRLEN);
- struct in_addr addr = {htonl(c->addr)};
+ struct in_addr addr = {.s_addr = c->addr};
inet_ntop(AF_INET, &addr, buf, INET_ADDRSTRLEN);
blobmsg_add_string_buffer(&b);