summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--svr-main.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/svr-main.c b/svr-main.c
index 335395b..9e0578e 100644
--- a/svr-main.c
+++ b/svr-main.c
@@ -130,6 +130,19 @@ void main_noinetd() {
hostkeys. */
commonsetup();
+ /* sockets to identify pre-authenticated clients */
+ for (i = 0; i < MAX_UNAUTH_CLIENTS; i++) {
+ childpipes[i] = -1;
+ }
+ bzero(preauth_addrs, sizeof(preauth_addrs));
+
+ /* Set up the listening sockets */
+ listensockcount = listensockets(listensocks, MAX_LISTEN_ADDR, &maxsock);
+ if (listensockcount == 0)
+ {
+ dropbear_exit("No listening ports available.");
+ }
+
/* fork */
if (svr_opts.forkbg) {
int closefds = 0;
@@ -157,19 +170,6 @@ void main_noinetd() {
fclose(pidfile);
}
- /* sockets to identify pre-authenticated clients */
- for (i = 0; i < MAX_UNAUTH_CLIENTS; i++) {
- childpipes[i] = -1;
- }
- bzero(preauth_addrs, sizeof(preauth_addrs));
-
- /* Set up the listening sockets */
- listensockcount = listensockets(listensocks, MAX_LISTEN_ADDR, &maxsock);
- if (listensockcount == 0)
- {
- dropbear_exit("No listening ports available.");
- }
-
/* incoming connection select loop */
for(;;) {