summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2020-03-14 21:03:11 +0100
committerHans Dedecker <dedeckeh@gmail.com>2020-03-14 21:06:21 +0100
commit6594c6b182a9065570316cf3a7a6a72a7afda150 (patch)
treec6b53f7821ee773ac5aede544b454d0359701c0a /src
parenta90cc2e147b0f6e429c4e5e3e4e42e00b01ec32c (diff)
ubus: use dhcpv6 ia assignment flag
Further align the code to use DHCPv6 assignment flags to distinguish between prefix delegation and non temporary address assignments Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/dhcpv6-ia.c2
-rw-r--r--src/ubus.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c
index 836c111..1a13945 100644
--- a/src/dhcpv6-ia.c
+++ b/src/dhcpv6-ia.c
@@ -234,7 +234,7 @@ void dhcpv6_ia_enum_addrs(struct interface *iface, struct dhcp_assignment *c,
addr = addrs[i].addr.in6;
pref = addrs[i].preferred;
valid = addrs[i].valid;
- if (prefix == 128) {
+ if (c->flags & OAF_DHCPV6_NA) {
if (!ADDR_ENTRY_VALID_IA_ADDR(iface, i, m, addrs))
continue;
diff --git a/src/ubus.c b/src/ubus.c
index e9c5b6f..72d47c4 100644
--- a/src/ubus.c
+++ b/src/ubus.c
@@ -155,7 +155,7 @@ static int handle_dhcpv6_leases(_unused struct ubus_context *ctx, _unused struct
blobmsg_add_string(&b, NULL, "static");
blobmsg_close_array(&b, m);
- m = blobmsg_open_array(&b, a->length == 128 ? "ipv6-addr": "ipv6-prefix");
+ m = blobmsg_open_array(&b, a->flags & OAF_DHCPV6_NA ? "ipv6-addr": "ipv6-prefix");
dhcpv6_ia_enum_addrs(iface, a, now, dhcpv6_blobmsg_ia_addr, NULL);
blobmsg_close_table(&b, m);