summaryrefslogtreecommitdiffstats
path: root/usr.bin/rlogin
diff options
context:
space:
mode:
authorshin <shin@FreeBSD.org>2000-01-25 14:52:10 +0000
committershin <shin@FreeBSD.org>2000-01-25 14:52:10 +0000
commitfc29f7bcf7236935ba5c171ea553ac7dca533e8c (patch)
tree13e93b815761d57bc661099e5a2b7bcb2882b762 /usr.bin/rlogin
parent4497b0fbabcff52472040173a4ea879ec212ecaa (diff)
downloadFreeBSD-src-fc29f7bcf7236935ba5c171ea553ac7dca533e8c.zip
FreeBSD-src-fc29f7bcf7236935ba5c171ea553ac7dca533e8c.tar.gz
several tcp apps IPv6 update
-inetd -rshd -rlogind -telnetd -rsh -rlogin Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project
Diffstat (limited to 'usr.bin/rlogin')
-rw-r--r--usr.bin/rlogin/rlogin.12
-rw-r--r--usr.bin/rlogin/rlogin.c18
2 files changed, 16 insertions, 4 deletions
diff --git a/usr.bin/rlogin/rlogin.1 b/usr.bin/rlogin/rlogin.1
index e2fa76c..3e3a749 100644
--- a/usr.bin/rlogin/rlogin.1
+++ b/usr.bin/rlogin/rlogin.1
@@ -226,6 +226,8 @@ The
.Nm
command appeared in
.Bx 4.2 .
+.Pp
+IPv6 support was added by WIDE/KAME project.
.Sh BUGS
.Nm Rlogin
will be replaced by
diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c
index 0df97a3..4f2cb6b 100644
--- a/usr.bin/rlogin/rlogin.c
+++ b/usr.bin/rlogin/rlogin.c
@@ -154,6 +154,8 @@ main(argc, argv)
#ifdef KERBEROS
char *k;
#endif
+ struct sockaddr_storage ss;
+ int sslen;
argoff = dflag = Dflag = 0;
one = 1;
@@ -331,10 +333,11 @@ main(argc, argv)
if (doencrypt)
errx(1, "the -x flag requires Kerberos authentication");
#endif /* CRYPT */
- rem = rcmd(&host, sp->s_port, localname, user, term, 0);
+ rem = rcmd_af(&host, sp->s_port, localname, user, term, 0,
+ PF_UNSPEC);
}
#else
- rem = rcmd(&host, sp->s_port, localname, user, term, 0);
+ rem = rcmd_af(&host, sp->s_port, localname, user, term, 0, PF_UNSPEC);
#endif /* KERBEROS */
if (rem < 0)
@@ -347,9 +350,16 @@ main(argc, argv)
setsockopt(rem, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)) < 0)
warn("setsockopt NODELAY (ignored)");
+ sslen = sizeof(ss);
one = IPTOS_LOWDELAY;
- if (setsockopt(rem, IPPROTO_IP, IP_TOS, (char *)&one, sizeof(int)) < 0)
- warn("setsockopt TOS (ignored)");
+ if (getsockname(rem, (struct sockaddr *)&ss, &sslen) == 0 &&
+ ss.ss_family == AF_INET) {
+ if (setsockopt(rem, IPPROTO_IP, IP_TOS, (char *)&one,
+ sizeof(int)) < 0)
+ warn("setsockopt TOS (ignored)");
+ } else
+ if (ss.ss_family == AF_INET)
+ warn("setsockopt getsockname failed");
(void)setuid(uid);
doit(omask);
OpenPOWER on IntegriCloud