From acd781a81901f9785125ea2c4c99d5d0952eecdd Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 13 May 2018 15:31:15 +0100 Subject: [PATCH] server/tripe.c: Establish the stdio admin client early. This way, warnings from peer initialization, for example, are reported to the stdio admin client rather than stderr. --- server/tripe.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/tripe.c b/server/tripe.c index 60460598..aa225da7 100644 --- a/server/tripe.c +++ b/server/tripe.c @@ -292,10 +292,7 @@ int main(int argc, char *argv[]) rand_noisesrc(RAND_GLOBAL, &noise_source); rand_seed(RAND_GLOBAL, MAXHASHSZ); signal(SIGPIPE, SIG_IGN); - for (i = 0; tunnels[i]; i++) - tunnels[i]->init(); - p_init(); - p_bind(ailist); freeaddrinfo(ailist); + if (!(f & f_daemon)) { af = AF_WARN; #ifndef NTRACE @@ -307,6 +304,11 @@ int main(int argc, char *argv[]) a_switcherr(); } + p_init(); + for (i = 0; tunnels[i]; i++) + tunnels[i]->init(); + p_bind(ailist); freeaddrinfo(ailist); + for (i = 0; tunnels[i]; i++) { if (tunnels[i]->flags&TUNF_PRIVOPEN) { ps_split(f & f_daemon); -- 2.11.0