From: Guus Sliepen Date: Sat, 16 May 2015 00:01:54 +0000 (+0200) Subject: Let sockaddr2str() handle AF_UNSPEC addresses. X-Git-Tag: release-1.1pre12~159 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=eecfeadeb4fc70ee002b81c20ba12ba3e3acb843;p=tinc Let sockaddr2str() handle AF_UNSPEC addresses. --- diff --git a/src/netutl.c b/src/netutl.c index bff734e1..701a4309 100644 --- a/src/netutl.c +++ b/src/netutl.c @@ -83,7 +83,13 @@ void sockaddr2str(const sockaddr_t *sa, char **addrstr, char **portstr) { char *scopeid; int err; - if(sa->sa.sa_family == AF_UNKNOWN) { + if(sa->sa.sa_family == AF_UNSPEC) { + if(addrstr) + *addrstr = xstrdup("unspec"); + if(portstr) + *portstr = xstrdup("unspec"); + return; + } else if(sa->sa.sa_family == AF_UNKNOWN) { if(addrstr) *addrstr = xstrdup(sa->unknown.address); if(portstr)