projects
/
oweals
/
tinc.git
/ 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 bff734e13c79a942d8649642d0c25dd43c2a8f0e..701a430935db52c145cdb12f5401fbe711d2dcf5 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)