aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/rlogin/rlogin.c
diff options
context:
space:
mode:
authorYoshinobu Inoue <shin@FreeBSD.org>2000-01-25 14:52:10 +0000
committerYoshinobu Inoue <shin@FreeBSD.org>2000-01-25 14:52:10 +0000
commit0cac72f42c2f9dfe7953cb3dd7c2e93d1d0c61cf (patch)
treec8a27c2bedbb21bf9014b25f896a4e3240049a25 /usr.bin/rlogin/rlogin.c
parent71207448cf3eb42617320efb36e7aa9d76c4c98e (diff)
downloadsrc-0cac72f42c2f9dfe7953cb3dd7c2e93d1d0c61cf.tar.gz
src-0cac72f42c2f9dfe7953cb3dd7c2e93d1d0c61cf.zip
several tcp apps IPv6 update
-inetd -rshd -rlogind -telnetd -rsh -rlogin Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project
Notes
Notes: svn path=/head/; revision=56590
Diffstat (limited to 'usr.bin/rlogin/rlogin.c')
-rw-r--r--usr.bin/rlogin/rlogin.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c
index 0df97a34bcf0..4f2cb6bfb112 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);