From: Sven-Haegar Koch Date: Sun, 17 May 2015 03:29:21 +0000 (+0200) Subject: Let sockaddr2hostname() handle AF_UNSPEC addresses. X-Git-Tag: release-1.1pre12~157 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=23fda4db6d1bb400a97f6d2a07d9b700f9546129;p=tinc Let sockaddr2hostname() handle AF_UNSPEC addresses. --- diff --git a/src/netutl.c b/src/netutl.c index 701a4309..2eebb644 100644 --- a/src/netutl.c +++ b/src/netutl.c @@ -121,7 +121,10 @@ char *sockaddr2hostname(const sockaddr_t *sa) { char port[NI_MAXSERV] = "unknown"; int err; - if(sa->sa.sa_family == AF_UNKNOWN) { + if(sa->sa.sa_family == AF_UNSPEC) { + xasprintf(&str, "unspec port unspec"); + return str; + } else if(sa->sa.sa_family == AF_UNKNOWN) { xasprintf(&str, "%s port %s", sa->unknown.address, sa->unknown.port); return str; }