aboutsummaryrefslogtreecommitdiff
path: root/inet/test-ifaddrs.c
diff options
context:
space:
mode:
Diffstat (limited to 'inet/test-ifaddrs.c')
-rw-r--r--inet/test-ifaddrs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/inet/test-ifaddrs.c b/inet/test-ifaddrs.c
index 42fb7e7..52cda73 100644
--- a/inet/test-ifaddrs.c
+++ b/inet/test-ifaddrs.c
@@ -50,6 +50,9 @@ Name Flags Address Netmask Broadcast/Destination");
char abuf[64], mbuf[64], dbuf[64];
inline const char *addr_string (struct sockaddr *sa, char *buf)
{
+ if (sa == NULL)
+ return "<none>";
+
switch (sa->sa_family)
{
case AF_INET:
@@ -60,6 +63,10 @@ Name Flags Address Netmask Broadcast/Destination");
return inet_ntop (AF_INET6,
&((struct sockaddr_in6 *) sa)->sin6_addr,
buf, sizeof abuf);
+#ifdef AF_LINK
+ case AF_LINK:
+ return "<link>";
+#endif
case AF_UNSPEC:
return "---";
default: