summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/ubus.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ubus.c b/src/ubus.c
index c4fbf92..7d8fb2a 100644
--- a/src/ubus.c
+++ b/src/ubus.c
@@ -3,6 +3,8 @@
#include <libubox/uloop.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <sys/socket.h>
+#include <netdb.h>
#include <libubox/utils.h>
@@ -150,6 +152,11 @@ static int handle_dhcpv6_leases(_unused struct ubus_context *ctx, _unused struct
else
blobmsg_add_u16(&b, "assigned", a->assigned_subnet_id);
+ char hbuf[NI_MAXHOST] = "";
+ getnameinfo((struct sockaddr *)&a->peer, sizeof(a->peer),
+ hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST);
+ blobmsg_add_string(&b, "peer", hbuf);
+
m = blobmsg_open_array(&b, "flags");
if (a->flags & OAF_BOUND)
blobmsg_add_string(&b, NULL, "bound");