eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 609f9c8f439dec013809b501777f03287f27e3b2
parent d3a57d47f374c1fbd44cfe46c5ddaaa8a378463c
Author: Denis Kenzior <denkenz@gmail.com>
Date:   Wed,  4 Nov 2020 14:29:21 -0600

monitor: Also print IPv6 addresses

Diffstat:
Mmonitor/nlmon.c | 13+++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/monitor/nlmon.c b/monitor/nlmon.c @@ -6687,13 +6687,18 @@ static void print_ifa_flags(unsigned int indent, const char *str, static void print_inet_addr(unsigned int indent, const char *str, const void *buf, uint16_t size) { - struct in_addr addr; + int family; + char ip[INET6_ADDRSTRLEN]; - if (size != sizeof(struct in_addr)) + if (size == sizeof(struct in_addr)) + family = AF_INET; + else if (size == sizeof(struct in6_addr)) + family = AF_INET6; + else return; - addr = *((struct in_addr *) buf); - print_attr(indent, "%s: %s", str, inet_ntoa(addr)); + inet_ntop(family, buf, ip, sizeof(ip)); + print_attr(indent, "%s: %s", str, ip); } static struct attr_entry addr_entry[] = {