projects
/
oweals
/
tinc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Always call res_init() before getaddrinfo().
[oweals/tinc.git]
/
src
/
net_setup.c
diff --git
a/src/net_setup.c
b/src/net_setup.c
index 765a9ebf37a1ea0bd11b01c49b84247b6e76d87c..121b989279bff7a810d316cc9737396bb33ff43e 100644
(file)
--- a/
src/net_setup.c
+++ b/
src/net_setup.c
@@
-813,6
+813,10
@@
static bool setup_myself(void) {
hint.ai_protocol = IPPROTO_TCP;
hint.ai_flags = AI_PASSIVE;
+#ifdef HAVE_DECL_RES_INIT
+ // ensure glibc reloads /etc/resolv.conf.
+ res_init();
+#endif
err = getaddrinfo(address && *address ? address : NULL, port, &hint, &ai);
free(address);