ubus: display the point-to-point IPv4 address
authorHans Dedecker <dedeckeh@gmail.com>
Tue, 17 Oct 2017 20:16:44 +0000 (22:16 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Wed, 18 Oct 2017 19:58:34 +0000 (21:58 +0200)
Display the point-to-point IPv4 address as well when dumping
the IP address list in ubus.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
ubus.c

diff --git a/ubus.c b/ubus.c
index ebf9891d0d95e57304a60e6ba1375e7dc611b774..96bc2479e4a9eb01dceb2aa7db620f1cf3f572d6 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -441,6 +441,12 @@ interface_ip_dump_address_list(struct interface_ip_settings *ip, bool v6, bool e
 
                blobmsg_add_u32(&b, "mask", addr->mask);
 
+               if (addr->point_to_point) {
+                       buf = blobmsg_alloc_string_buffer(&b, "ptpaddress", buflen);
+                       inet_ntop(af, &addr->point_to_point, buf, buflen);
+                       blobmsg_add_string_buffer(&b);
+               }
+
                if (addr->preferred_until) {
                        int preferred = addr->preferred_until - now;
                        if (preferred < 0)