summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-01-19 14:36:49 +1100
committerDamien Miller <djm@mindrot.org>2000-01-19 14:36:49 +1100
commit7d80e3484b5a41249bee4d43b4c9a58d6ebe90a6 (patch)
tree80f2ae37acdadd0c5b409e63b454083e5367c6ab
parenteaf9994f7e5fdddb7ded0cd9d757921ed8a9dc67 (diff)
- Linux/glibc-2.1.2 takes a *long* time to look up names for AF_UNSPEC
addresses using getaddrinfo(). Added a configure switch to make the default lookup mode AF_INET
-rw-r--r--ChangeLog3
-rw-r--r--INSTALL6
-rw-r--r--acconfig.h3
-rw-r--r--configure.in9
-rw-r--r--ssh.c6
-rw-r--r--sshd.c6
6 files changed, 31 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6b6dd40b..5b7e5fcc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
20000119
- SCO compile fixes from Gary E. Miller <gem@rellim.com>
- Compile fix from Darren_Hall@progressive.com
+ - Linux/glibc-2.1.2 takes a *long* time to look up names for AF_UNSPEC
+ addresses using getaddrinfo(). Added a configure switch to make the
+ default lookup mode AF_INET
20000118
- Fixed --with-pid-dir option
diff --git a/INSTALL b/INSTALL
index 9ea5a253..95722e4d 100644
--- a/INSTALL
+++ b/INSTALL
@@ -150,6 +150,12 @@ created.
libsocks library isn't installed in a library searched by the compiler,
add the directory name as the option.
+--with-ipv4-default instructs OpenSSH to use IPv4 by default for new
+connections. Normally OpenSSH will try attempt to lookup both IPv6 and
+IPv4 addresses. On Linux/glibc-2.1.2 this causes long delays in name
+resolution. If this option is specified, you can still attempt to
+connect to IPv6 addresses using the command line option '-6'.
+
If you need to pass special options to the compiler or linker, you
can specify these as enviornment variables before running ./configure.
For example:
diff --git a/acconfig.h b/acconfig.h
index 30a1dc96..f143b1b1 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -135,6 +135,9 @@
/* Specify location of ssh.pid */
#undef PIDDIR
+/* Use IPv4 for connection by default, IPv6 can still if explicity asked */
+#undef IPV4_DEFAULT
+
@BOTTOM@
/* ******************* Shouldn't need to edit below this line ************** */
diff --git a/configure.in b/configure.in
index d11c519d..45df18f6 100644
--- a/configure.in
+++ b/configure.in
@@ -662,6 +662,15 @@ AC_ARG_WITH(default-path,
]
)
+AC_ARG_WITH(ipv4-default,
+ [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
+ [
+ if test "x$withval" != "xno" ; then
+ AC_DEFINE(IPV4_DEFAULT)
+ fi
+ ]
+)
+
piddir=/var/run
AC_ARG_WITH(pid-dir,
[ --with-pid-dir=PATH Specify location of ssh.pid file],
diff --git a/ssh.c b/ssh.c
index 962aa2d4..2a2fb2d3 100644
--- a/ssh.c
+++ b/ssh.c
@@ -11,7 +11,7 @@
*/
#include "includes.h"
-RCSID("$Id: ssh.c,v 1.16 2000/01/14 04:45:51 damien Exp $");
+RCSID("$Id: ssh.c,v 1.17 2000/01/19 03:36:49 damien Exp $");
#include "xmalloc.h"
#include "ssh.h"
@@ -29,7 +29,11 @@ const char *__progname = "ssh";
/* Flag indicating whether IPv4 or IPv6. This can be set on the command line.
Default value is AF_UNSPEC means both IPv4 and IPv6. */
+#ifdef IPV4_DEFAULT
+int IPv4or6 = AF_INET;
+#else
int IPv4or6 = AF_UNSPEC;
+#endif
/* Flag indicating whether debug mode is on. This can be set on the command line. */
int debug_flag = 0;
diff --git a/sshd.c b/sshd.c
index 316723a8..371b2a57 100644
--- a/sshd.c
+++ b/sshd.c
@@ -11,7 +11,7 @@
*/
#include "includes.h"
-RCSID("$Id: sshd.c,v 1.50 2000/01/14 04:45:52 damien Exp $");
+RCSID("$Id: sshd.c,v 1.51 2000/01/19 03:36:50 damien Exp $");
#include "xmalloc.h"
#include "rsa.h"
@@ -49,7 +49,11 @@ char *config_file_name = SERVER_CONFIG_FILE;
* Flag indicating whether IPv4 or IPv6. This can be set on the command line.
* Default value is AF_UNSPEC means both IPv4 and IPv6.
*/
+#ifdef IPV4_DEFAULT
+int IPv4or6 = AF_INET;
+#else
int IPv4or6 = AF_UNSPEC;
+#endif
/*
* Debug mode flag. This can be set on the command line. If debug