summaryrefslogtreecommitdiffhomepage
path: root/ubus.c
diff options
context:
space:
mode:
authorHans Dedecker <hans.dedecker@technicolor.com>2016-12-09 08:47:39 +0100
committerHans Dedecker <dedeckeh@gmail.com>2016-12-12 08:55:50 +0100
commitedc15caac6c6d3b2d8ea17f98ecbaba81ba573dc (patch)
treeb836feb96cd70e70cb81dc5908e215e04c12a673 /ubus.c
parent153a12143b9fef4b5d3c3a6597f6fe967a17c9d7 (diff)
ubus: Display the IPv6 prefix assigned address
Display the IPv6 address obtained from a prefix assignment as local-address element in the ubus ipv6-prefix-assignment list so it's explicitly clear which IPv6 address from the delegated prefix is assigned to interface. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'ubus.c')
-rw-r--r--ubus.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ubus.c b/ubus.c
index 8ba43c0..29924c1 100644
--- a/ubus.c
+++ b/ubus.c
@@ -600,12 +600,21 @@ interface_ip_dump_prefix_assignment_list(struct interface *iface)
if (prefix->valid_until)
blobmsg_add_u32(&b, "valid", prefix->valid_until - now);
+ void *c = blobmsg_open_table(&b, "local-address");
+ if (assign->enabled) {
+ buf = blobmsg_alloc_string_buffer(&b, "address", buflen);
+ inet_ntop(AF_INET6, &assign->addr, buf, buflen);
+ blobmsg_add_string_buffer(&b);
+
+ blobmsg_add_u32(&b, "mask", assign->length < 64 ? 64 : assign->length);
+ }
+ blobmsg_close_table(&b, c);
+
blobmsg_close_table(&b, a);
}
}
}
-
static void
interface_ip_dump_dns_server_list(struct interface_ip_settings *ip,
bool enabled)