summaryrefslogtreecommitdiffstats
path: root/usr.bin/rlogin
diff options
context:
space:
mode:
authorshin <shin@FreeBSD.org>2000-02-15 15:11:40 +0000
committershin <shin@FreeBSD.org>2000-02-15 15:11:40 +0000
commitc83f0a97bdc03cca93e16e1bc2758c713aef5fdf (patch)
tree04189aeeb90e88a6a240f49392fa61d89316107a /usr.bin/rlogin
parent6768336e3b66310544efe8dbe769fdda673c93f8 (diff)
downloadFreeBSD-src-c83f0a97bdc03cca93e16e1bc2758c713aef5fdf.zip
FreeBSD-src-c83f0a97bdc03cca93e16e1bc2758c713aef5fdf.tar.gz
Add -4 and -6 options.
Current getaddrinfo() implemetation has a problem of too much resolving waiting time on INET6 enabled systems. -4 and -6 options can limit name resolving address family and is a possible workaround for the problem. Approved by: jkh
Diffstat (limited to 'usr.bin/rlogin')
-rw-r--r--usr.bin/rlogin/rlogin.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c
index 4f2cb6b..fb3f3d4 100644
--- a/usr.bin/rlogin/rlogin.c
+++ b/usr.bin/rlogin/rlogin.c
@@ -95,6 +95,7 @@ char dst_realm_buf[REALM_SZ], *dest_realm = NULL;
#endif
int eight, litout, rem;
+int family = PF_UNSPEC;
int noescape;
u_char escapechar = '~';
@@ -176,12 +177,20 @@ main(argc, argv)
}
#ifdef KERBEROS
-#define OPTIONS "8DEKLde:i:k:l:x"
+#define OPTIONS "468DEKLde:i:k:l:x"
#else
-#define OPTIONS "8DEKLde:i:l:"
+#define OPTIONS "468DEKLde:i:l:"
#endif
while ((ch = getopt(argc - argoff, argv + argoff, OPTIONS)) != -1)
switch(ch) {
+ case '4':
+ family = PF_INET;
+ break;
+
+ case '6':
+ family = PF_INET6;
+ break;
+
case '8':
eight = 1;
break;
@@ -334,10 +343,10 @@ main(argc, argv)
errx(1, "the -x flag requires Kerberos authentication");
#endif /* CRYPT */
rem = rcmd_af(&host, sp->s_port, localname, user, term, 0,
- PF_UNSPEC);
+ family);
}
#else
- rem = rcmd_af(&host, sp->s_port, localname, user, term, 0, PF_UNSPEC);
+ rem = rcmd_af(&host, sp->s_port, localname, user, term, 0, family);
#endif /* KERBEROS */
if (rem < 0)
@@ -876,7 +885,7 @@ void
usage()
{
(void)fprintf(stderr,
- "usage: rlogin [-%s]%s[-e char] [-i localname] [-l username] host\n",
+ "usage: rlogin [-46%s]%s[-e char] [-i localname] [-l username] host\n",
#ifdef KERBEROS
#ifdef CRYPT
"8DEKLdx", " [-k realm] ");
OpenPOWER on IntegriCloud