mirror of
git://anongit.mindrot.org/openssh.git
synced 2024-11-27 05:46:36 +08:00
- stevesk@cvs.openbsd.org 2002/09/13 19:23:09
[channels.c sshconnect.c sshd.c] remove use of SO_LINGER, it should not be needed. error check SO_REUSEADDR. fixup comments. ok markus@
This commit is contained in:
parent
f37e246f85
commit
e1383cee9d
@ -6,6 +6,10 @@
|
||||
- stevesk@cvs.openbsd.org 2002/09/12 19:50:36
|
||||
[session.c ssh.1]
|
||||
add SSH_CONNECTION and deprecate SSH_CLIENT; bug #384. ok markus@
|
||||
- stevesk@cvs.openbsd.org 2002/09/13 19:23:09
|
||||
[channels.c sshconnect.c sshd.c]
|
||||
remove use of SO_LINGER, it should not be needed. error check
|
||||
SO_REUSEADDR. fixup comments. ok markus@
|
||||
|
||||
20020912
|
||||
- (djm) Made GNOME askpass programs return non-zero if cancel button is
|
||||
@ -656,4 +660,4 @@
|
||||
save auth method before monitor_reset_key_state(); bugzilla bug #284;
|
||||
ok provos@
|
||||
|
||||
$Id: ChangeLog,v 1.2465 2002/09/19 01:47:55 djm Exp $
|
||||
$Id: ChangeLog,v 1.2466 2002/09/19 01:49:37 djm Exp $
|
||||
|
15
channels.c
15
channels.c
@ -39,7 +39,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: channels.c,v 1.181 2002/09/09 14:54:14 markus Exp $");
|
||||
RCSID("$OpenBSD: channels.c,v 1.182 2002/09/13 19:23:09 stevesk Exp $");
|
||||
|
||||
#include "ssh.h"
|
||||
#include "ssh1.h"
|
||||
@ -2022,7 +2022,6 @@ channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_por
|
||||
struct addrinfo hints, *ai, *aitop;
|
||||
const char *host;
|
||||
char ntop[NI_MAXHOST], strport[NI_MAXSERV];
|
||||
struct linger linger;
|
||||
|
||||
success = 0;
|
||||
host = (type == SSH_CHANNEL_RPORT_LISTENER) ?
|
||||
@ -2065,13 +2064,13 @@ channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_por
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* Set socket options. We would like the socket to disappear
|
||||
* as soon as it has been closed for whatever reason.
|
||||
* Set socket options.
|
||||
* Allow local port reuse in TIME_WAIT.
|
||||
*/
|
||||
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
|
||||
linger.l_onoff = 1;
|
||||
linger.l_linger = 5;
|
||||
setsockopt(sock, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger));
|
||||
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on,
|
||||
sizeof(on)) == -1)
|
||||
error("setsockopt SO_REUSEADDR: %s", strerror(errno));
|
||||
|
||||
debug("Local forwarding listening on %s port %s.", ntop, strport);
|
||||
|
||||
/* Bind the socket to the address. */
|
||||
|
12
sshconnect.c
12
sshconnect.c
@ -13,7 +13,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: sshconnect.c,v 1.133 2002/07/29 18:57:30 markus Exp $");
|
||||
RCSID("$OpenBSD: sshconnect.c,v 1.134 2002/09/13 19:23:09 stevesk Exp $");
|
||||
|
||||
#include <openssl/bn.h>
|
||||
|
||||
@ -229,7 +229,6 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
|
||||
int sock = -1, attempt;
|
||||
char ntop[NI_MAXHOST], strport[NI_MAXSERV];
|
||||
struct addrinfo hints, *ai, *aitop;
|
||||
struct linger linger;
|
||||
struct servent *sp;
|
||||
/*
|
||||
* Did we get only other errors than "Connection refused" (which
|
||||
@ -330,15 +329,6 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
|
||||
|
||||
debug("Connection established.");
|
||||
|
||||
/*
|
||||
* Set socket options. We would like the socket to disappear as soon
|
||||
* as it has been closed for whatever reason.
|
||||
*/
|
||||
/* setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)); */
|
||||
linger.l_onoff = 1;
|
||||
linger.l_linger = 5;
|
||||
setsockopt(sock, SOL_SOCKET, SO_LINGER, (void *)&linger, sizeof(linger));
|
||||
|
||||
/* Set keepalives if requested. */
|
||||
if (options.keepalives &&
|
||||
setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (void *)&on,
|
||||
|
28
sshd.c
28
sshd.c
@ -42,7 +42,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: sshd.c,v 1.257 2002/07/23 16:03:10 stevesk Exp $");
|
||||
RCSID("$OpenBSD: sshd.c,v 1.258 2002/09/13 19:23:09 stevesk Exp $");
|
||||
|
||||
#include <openssl/dh.h>
|
||||
#include <openssl/bn.h>
|
||||
@ -806,7 +806,6 @@ main(int ac, char **av)
|
||||
const char *remote_ip;
|
||||
int remote_port;
|
||||
FILE *f;
|
||||
struct linger linger;
|
||||
struct addrinfo *ai;
|
||||
char ntop[NI_MAXHOST], strport[NI_MAXSERV];
|
||||
int listen_sock, maxfd;
|
||||
@ -1152,17 +1151,12 @@ main(int ac, char **av)
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* Set socket options. We try to make the port
|
||||
* reusable and have it close as fast as possible
|
||||
* without waiting in unnecessary wait states on
|
||||
* close.
|
||||
* Set socket options.
|
||||
* Allow local port reuse in TIME_WAIT.
|
||||
*/
|
||||
setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR,
|
||||
&on, sizeof(on));
|
||||
linger.l_onoff = 1;
|
||||
linger.l_linger = 5;
|
||||
setsockopt(listen_sock, SOL_SOCKET, SO_LINGER,
|
||||
&linger, sizeof(linger));
|
||||
if (setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR,
|
||||
&on, sizeof(on)) == -1)
|
||||
error("setsockopt SO_REUSEADDR: %s", strerror(errno));
|
||||
|
||||
debug("Bind to port %s on %s.", strport, ntop);
|
||||
|
||||
@ -1411,16 +1405,6 @@ main(int ac, char **av)
|
||||
signal(SIGCHLD, SIG_DFL);
|
||||
signal(SIGINT, SIG_DFL);
|
||||
|
||||
/*
|
||||
* Set socket options for the connection. We want the socket to
|
||||
* close as fast as possible without waiting for anything. If the
|
||||
* connection is not a socket, these will do nothing.
|
||||
*/
|
||||
/* setsockopt(sock_in, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)); */
|
||||
linger.l_onoff = 1;
|
||||
linger.l_linger = 5;
|
||||
setsockopt(sock_in, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger));
|
||||
|
||||
/* Set keepalives if requested. */
|
||||
if (options.keepalives &&
|
||||
setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, &on,
|
||||
|
Loading…
Reference in New Issue
Block a user