projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
613c121
)
Let sockaddr2str() handle AF_UNSPEC addresses.
author
Guus Sliepen
<guus@tinc-vpn.org>
Sat, 16 May 2015 00:01:54 +0000
(
02:01
+0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sat, 16 May 2015 00:01:54 +0000
(
02:01
+0200)
src/netutl.c
patch
|
blob
|
history
diff --git
a/src/netutl.c
b/src/netutl.c
index
bff734e
..
701a430
100644
(file)
--- 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)