From fce397492fcee903dcdb8062249ecbeaddfe745d Mon Sep 17 00:00:00 2001 From: dtucker Date: Tue, 9 Dec 2003 08:15:11 +0000 Subject: [PATCH] - markus@cvs.openbsd.org 2003/12/02 17:01:15 [channels.c session.c ssh-agent.c ssh.h sshd.c] use SSH_LISTEN_BACKLOG (=128) in listen(2). --- ChangeLog | 3 +++ channels.c | 6 +++--- session.c | 4 ++-- ssh-agent.c | 4 ++-- ssh.h | 5 ++++- sshd.c | 4 ++-- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b3af8ae..7513e266 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,9 @@ rounding the time to 1 second. * when the transfer is finished calculate the actual total speed rather than the current speed which is given during the transfer + - markus@cvs.openbsd.org 2003/12/02 17:01:15 + [channels.c session.c ssh-agent.c ssh.h sshd.c] + use SSH_LISTEN_BACKLOG (=128) in listen(2). 20031208 - (tim) [configure.ac] Bug 770. Fix --without-rpath. diff --git a/channels.c b/channels.c index 5a2605f9..14405bd4 100644 --- a/channels.c +++ b/channels.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: channels.c,v 1.198 2003/11/21 11:57:03 djm Exp $"); +RCSID("$OpenBSD: channels.c,v 1.199 2003/12/02 17:01:14 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -2195,7 +2195,7 @@ channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_por continue; } /* Start listening for connections on the socket. */ - if (listen(sock, 5) < 0) { + if (listen(sock, SSH_LISTEN_BACKLOG) < 0) { error("listen: %.100s", strerror(errno)); close(sock); continue; @@ -2550,7 +2550,7 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost, /* Start listening for connections on the socket. */ for (n = 0; n < num_socks; n++) { sock = socks[n]; - if (listen(sock, 5) < 0) { + if (listen(sock, SSH_LISTEN_BACKLOG) < 0) { error("listen: %.100s", strerror(errno)); close(sock); return -1; diff --git a/session.c b/session.c index 63b7da1f..00f8785f 100644 --- a/session.c +++ b/session.c @@ -33,7 +33,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.168 2003/11/21 11:57:03 djm Exp $"); +RCSID("$OpenBSD: session.c,v 1.169 2003/12/02 17:01:15 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -177,7 +177,7 @@ auth_input_request_forwarding(struct passwd * pw) restore_uid(); /* Start listening on the socket. */ - if (listen(sock, 5) < 0) + if (listen(sock, SSH_LISTEN_BACKLOG) < 0) packet_disconnect("listen: %.100s", strerror(errno)); /* Allocate a channel for the authentication agent socket. */ diff --git a/ssh-agent.c b/ssh-agent.c index b1d60300..e5232fc9 100644 --- a/ssh-agent.c +++ b/ssh-agent.c @@ -35,7 +35,7 @@ #include "includes.h" #include "openbsd-compat/sys-queue.h" -RCSID("$OpenBSD: ssh-agent.c,v 1.116 2003/11/21 11:57:03 djm Exp $"); +RCSID("$OpenBSD: ssh-agent.c,v 1.117 2003/12/02 17:01:15 markus Exp $"); #include #include @@ -1138,7 +1138,7 @@ main(int ac, char **av) #ifdef HAVE_CYGWIN umask(prev_mask); #endif - if (listen(sock, 128) < 0) { + if (listen(sock, SSH_LISTEN_BACKLOG) < 0) { perror("listen"); cleanup_exit(1); } diff --git a/ssh.h b/ssh.h index e88b9b83..a3b2ebbb 100644 --- a/ssh.h +++ b/ssh.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.h,v 1.74 2003/09/01 13:52:18 markus Exp $ */ +/* $OpenBSD: ssh.h,v 1.75 2003/12/02 17:01:15 markus Exp $ */ /* * Author: Tatu Ylonen @@ -103,4 +103,7 @@ /* Minimum modulus size (n) for RSA keys. */ #define SSH_RSA_MINIMUM_MODULUS_SIZE 768 +/* Listen backlog for sshd, ssh-agent and forwarding sockets */ +#define SSH_LISTEN_BACKLOG 128 + #endif /* SSH_H */ diff --git a/sshd.c b/sshd.c index e92a13c5..b45bc0ab 100644 --- a/sshd.c +++ b/sshd.c @@ -42,7 +42,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshd.c,v 1.281 2003/11/10 16:23:41 jakob Exp $"); +RCSID("$OpenBSD: sshd.c,v 1.282 2003/12/02 17:01:15 markus Exp $"); #include #include @@ -1161,7 +1161,7 @@ main(int ac, char **av) /* Start listening on the port. */ logit("Server listening on %s port %s.", ntop, strport); - if (listen(listen_sock, 5) < 0) + if (listen(listen_sock, SSH_LISTEN_BACKLOG) < 0) fatal("listen: %.100s", strerror(errno)); } -- 2.45.2