summaryrefslogtreecommitdiffhomepage
path: root/src/ubus.c
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2021-07-14 22:46:55 +0200
committerHans Dedecker <dedeckeh@gmail.com>2021-08-14 21:11:30 +0200
commit16667699228101fda936068e3d11c0cf19270e34 (patch)
tree48cf08135c5286bb45c8c5f3606b92208f811fdc /src/ubus.c
parentbc9d317f2921ae6b529f2c9f8de79b75992e206f (diff)
dhcpv6-ia: allow up to 64 bit wide hostid
Add dhcpv6_hostid_len config option which controls the number of bits in the host identifier of dynamically assigned IPv6 addresses. The default is 12 bits which is also the minimum. The maximum is the whole interface identifier, i.e. 64 bits. Allow up to 64 bit wide hostid in static leases. Fixes #84 and #27. Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/ubus.c')
-rw-r--r--src/ubus.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ubus.c b/src/ubus.c
index ebc3103..45b29a4 100644
--- a/src/ubus.c
+++ b/src/ubus.c
@@ -145,7 +145,10 @@ static int handle_dhcpv6_leases(_unused struct ubus_context *ctx, _unused struct
blobmsg_add_u32(&b, "iaid", ntohl(a->iaid));
blobmsg_add_string(&b, "hostname", (a->hostname) ? a->hostname : "");
blobmsg_add_u8(&b, "accept-reconf", a->accept_reconf);
- blobmsg_add_u32(&b, "assigned", a->assigned);
+ if (a->flags & OAF_DHCPV6_NA)
+ blobmsg_add_u64(&b, "assigned", a->assigned_host_id);
+ else
+ blobmsg_add_u16(&b, "assigned", a->assigned_subnet_id);
m = blobmsg_open_array(&b, "flags");
if (a->flags & OAF_BOUND)