summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--channels.c15
-rw-r--r--sshconnect.c12
-rw-r--r--sshd.c28
4 files changed, 19 insertions, 42 deletions
diff --git a/ChangeLog b/ChangeLog
index 43c701af3..b0b40b288 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,10 @@
6 - stevesk@cvs.openbsd.org 2002/09/12 19:50:36 6 - stevesk@cvs.openbsd.org 2002/09/12 19:50:36
7 [session.c ssh.1] 7 [session.c ssh.1]
8 add SSH_CONNECTION and deprecate SSH_CLIENT; bug #384. ok markus@ 8 add SSH_CONNECTION and deprecate SSH_CLIENT; bug #384. ok markus@
9 - stevesk@cvs.openbsd.org 2002/09/13 19:23:09
10 [channels.c sshconnect.c sshd.c]
11 remove use of SO_LINGER, it should not be needed. error check
12 SO_REUSEADDR. fixup comments. ok markus@
9 13
1020020912 1420020912
11 - (djm) Made GNOME askpass programs return non-zero if cancel button is 15 - (djm) Made GNOME askpass programs return non-zero if cancel button is
@@ -656,4 +660,4 @@
656 save auth method before monitor_reset_key_state(); bugzilla bug #284; 660 save auth method before monitor_reset_key_state(); bugzilla bug #284;
657 ok provos@ 661 ok provos@
658 662
659$Id: ChangeLog,v 1.2465 2002/09/19 01:47:55 djm Exp $ 663$Id: ChangeLog,v 1.2466 2002/09/19 01:49:37 djm Exp $
diff --git a/channels.c b/channels.c
index 0ae37b6d8..cf1a6462b 100644
--- a/channels.c
+++ b/channels.c
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: channels.c,v 1.181 2002/09/09 14:54:14 markus Exp $"); 42RCSID("$OpenBSD: channels.c,v 1.182 2002/09/13 19:23:09 stevesk Exp $");
43 43
44#include "ssh.h" 44#include "ssh.h"
45#include "ssh1.h" 45#include "ssh1.h"
@@ -2022,7 +2022,6 @@ channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_por
2022 struct addrinfo hints, *ai, *aitop; 2022 struct addrinfo hints, *ai, *aitop;
2023 const char *host; 2023 const char *host;
2024 char ntop[NI_MAXHOST], strport[NI_MAXSERV]; 2024 char ntop[NI_MAXHOST], strport[NI_MAXSERV];
2025 struct linger linger;
2026 2025
2027 success = 0; 2026 success = 0;
2028 host = (type == SSH_CHANNEL_RPORT_LISTENER) ? 2027 host = (type == SSH_CHANNEL_RPORT_LISTENER) ?
@@ -2065,13 +2064,13 @@ channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_por
2065 continue; 2064 continue;
2066 } 2065 }
2067 /* 2066 /*
2068 * Set socket options. We would like the socket to disappear 2067 * Set socket options.
2069 * as soon as it has been closed for whatever reason. 2068 * Allow local port reuse in TIME_WAIT.
2070 */ 2069 */
2071 setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); 2070 if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on,
2072 linger.l_onoff = 1; 2071 sizeof(on)) == -1)
2073 linger.l_linger = 5; 2072 error("setsockopt SO_REUSEADDR: %s", strerror(errno));
2074 setsockopt(sock, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger)); 2073
2075 debug("Local forwarding listening on %s port %s.", ntop, strport); 2074 debug("Local forwarding listening on %s port %s.", ntop, strport);
2076 2075
2077 /* Bind the socket to the address. */ 2076 /* Bind the socket to the address. */
diff --git a/sshconnect.c b/sshconnect.c
index 6004bf5e4..0cb824852 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: sshconnect.c,v 1.133 2002/07/29 18:57:30 markus Exp $"); 16RCSID("$OpenBSD: sshconnect.c,v 1.134 2002/09/13 19:23:09 stevesk Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19 19
@@ -229,7 +229,6 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
229 int sock = -1, attempt; 229 int sock = -1, attempt;
230 char ntop[NI_MAXHOST], strport[NI_MAXSERV]; 230 char ntop[NI_MAXHOST], strport[NI_MAXSERV];
231 struct addrinfo hints, *ai, *aitop; 231 struct addrinfo hints, *ai, *aitop;
232 struct linger linger;
233 struct servent *sp; 232 struct servent *sp;
234 /* 233 /*
235 * Did we get only other errors than "Connection refused" (which 234 * Did we get only other errors than "Connection refused" (which
@@ -330,15 +329,6 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
330 329
331 debug("Connection established."); 330 debug("Connection established.");
332 331
333 /*
334 * Set socket options. We would like the socket to disappear as soon
335 * as it has been closed for whatever reason.
336 */
337 /* setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)); */
338 linger.l_onoff = 1;
339 linger.l_linger = 5;
340 setsockopt(sock, SOL_SOCKET, SO_LINGER, (void *)&linger, sizeof(linger));
341
342 /* Set keepalives if requested. */ 332 /* Set keepalives if requested. */
343 if (options.keepalives && 333 if (options.keepalives &&
344 setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (void *)&on, 334 setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (void *)&on,
diff --git a/sshd.c b/sshd.c
index 55c57e195..17f001669 100644
--- a/sshd.c
+++ b/sshd.c
@@ -42,7 +42,7 @@
42 */ 42 */
43 43
44#include "includes.h" 44#include "includes.h"
45RCSID("$OpenBSD: sshd.c,v 1.257 2002/07/23 16:03:10 stevesk Exp $"); 45RCSID("$OpenBSD: sshd.c,v 1.258 2002/09/13 19:23:09 stevesk Exp $");
46 46
47#include <openssl/dh.h> 47#include <openssl/dh.h>
48#include <openssl/bn.h> 48#include <openssl/bn.h>
@@ -806,7 +806,6 @@ main(int ac, char **av)
806 const char *remote_ip; 806 const char *remote_ip;
807 int remote_port; 807 int remote_port;
808 FILE *f; 808 FILE *f;
809 struct linger linger;
810 struct addrinfo *ai; 809 struct addrinfo *ai;
811 char ntop[NI_MAXHOST], strport[NI_MAXSERV]; 810 char ntop[NI_MAXHOST], strport[NI_MAXSERV];
812 int listen_sock, maxfd; 811 int listen_sock, maxfd;
@@ -1152,17 +1151,12 @@ main(int ac, char **av)
1152 continue; 1151 continue;
1153 } 1152 }
1154 /* 1153 /*
1155 * Set socket options. We try to make the port 1154 * Set socket options.
1156 * reusable and have it close as fast as possible 1155 * Allow local port reuse in TIME_WAIT.
1157 * without waiting in unnecessary wait states on
1158 * close.
1159 */ 1156 */
1160 setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, 1157 if (setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR,
1161 &on, sizeof(on)); 1158 &on, sizeof(on)) == -1)
1162 linger.l_onoff = 1; 1159 error("setsockopt SO_REUSEADDR: %s", strerror(errno));
1163 linger.l_linger = 5;
1164 setsockopt(listen_sock, SOL_SOCKET, SO_LINGER,
1165 &linger, sizeof(linger));
1166 1160
1167 debug("Bind to port %s on %s.", strport, ntop); 1161 debug("Bind to port %s on %s.", strport, ntop);
1168 1162
@@ -1411,16 +1405,6 @@ main(int ac, char **av)
1411 signal(SIGCHLD, SIG_DFL); 1405 signal(SIGCHLD, SIG_DFL);
1412 signal(SIGINT, SIG_DFL); 1406 signal(SIGINT, SIG_DFL);
1413 1407
1414 /*
1415 * Set socket options for the connection. We want the socket to
1416 * close as fast as possible without waiting for anything. If the
1417 * connection is not a socket, these will do nothing.
1418 */
1419 /* setsockopt(sock_in, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)); */
1420 linger.l_onoff = 1;
1421 linger.l_linger = 5;
1422 setsockopt(sock_in, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger));
1423
1424 /* Set keepalives if requested. */ 1408 /* Set keepalives if requested. */
1425 if (options.keepalives && 1409 if (options.keepalives &&
1426 setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, &on, 1410 setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, &on,