diff options
Diffstat (limited to 'src/ubus.c')
-rw-r--r-- | src/ubus.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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"); |