Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin IPv6 support. (I thought I've committed these but wa...
details: https://anonhg.NetBSD.org/src/rev/1dee243983c6
branches: trunk
changeset: 481444:1dee243983c6
user: itojun <itojun%NetBSD.org@localhost>
date: Mon Jan 31 14:19:34 2000 +0000
description:
IPv6 support. (I thought I've committed these but was not yet)
diffstat:
usr.bin/rlogin/rlogin.c | 25 ++++++++++++++++++-------
usr.bin/rsh/rsh.c | 18 ++++++++++--------
2 files changed, 28 insertions(+), 15 deletions(-)
diffs (112 lines):
diff -r 8c6ddb6aa930 -r 1dee243983c6 usr.bin/rlogin/rlogin.c
--- a/usr.bin/rlogin/rlogin.c Mon Jan 31 14:18:52 2000 +0000
+++ b/usr.bin/rlogin/rlogin.c Mon Jan 31 14:19:34 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rlogin.c,v 1.23 1999/07/11 18:21:18 thorpej Exp $ */
+/* $NetBSD: rlogin.c,v 1.24 2000/01/31 14:19:35 itojun Exp $ */
/*
* Copyright (c) 1983, 1990, 1993
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)rlogin.c 8.4 (Berkeley) 4/29/95";
#else
-__RCSID("$NetBSD: rlogin.c,v 1.23 1999/07/11 18:21:18 thorpej Exp $");
+__RCSID("$NetBSD: rlogin.c,v 1.24 2000/01/31 14:19:35 itojun Exp $");
#endif
#endif /* not lint */
@@ -400,12 +400,13 @@
if (doencrypt)
errx(1, "the -x flag requires Kerberos authentication.");
#endif /* CRYPT */
- rem = rcmd(&host, sp->s_port, name, user, term, 0);
+ rem = rcmd_af(&host, sp->s_port, name, user, term, 0,
+ PF_UNSPEC);
if (rem < 0)
exit(1);
}
#else
- rem = rcmd(&host, sp->s_port, name, user, term, 0);
+ rem = rcmd_af(&host, sp->s_port, name, user, term, 0, PF_UNSPEC);
#endif /* KERBEROS */
@@ -415,9 +416,19 @@
if (dflag &&
setsockopt(rem, SOL_SOCKET, SO_DEBUG, &one, sizeof(one)) < 0)
warn("setsockopt DEBUG (ignored)");
- one = IPTOS_LOWDELAY;
- if (setsockopt(rem, IPPROTO_IP, IP_TOS, (char *)&one, sizeof(int)) < 0)
- warn("setsockopt TOS (ignored)");
+ {
+ struct sockaddr_storage ss;
+ int sslen;
+ sslen = sizeof(ss);
+ if (getsockname(rem, (struct sockaddr *)&ss, &sslen) == 0
+ && ((struct sockaddr *)&ss)->sa_family == AF_INET) {
+ one = IPTOS_LOWDELAY;
+ if (setsockopt(rem, IPPROTO_IP, IP_TOS, (char *)&one,
+ sizeof(int)) < 0) {
+ warn("setsockopt TOS (ignored)");
+ }
+ }
+ }
(void)setuid(uid);
doit(&smask);
diff -r 8c6ddb6aa930 -r 1dee243983c6 usr.bin/rsh/rsh.c
--- a/usr.bin/rsh/rsh.c Mon Jan 31 14:18:52 2000 +0000
+++ b/usr.bin/rsh/rsh.c Mon Jan 31 14:19:34 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rsh.c,v 1.12 1997/07/20 20:44:23 christos Exp $ */
+/* $NetBSD: rsh.c,v 1.13 2000/01/31 14:19:34 itojun Exp $ */
/*-
* Copyright (c) 1983, 1990, 1993, 1994
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)rsh.c 8.4 (Berkeley) 4/29/95";
#else
-__RCSID("$NetBSD: rsh.c,v 1.12 1997/07/20 20:44:23 christos Exp $");
+__RCSID("$NetBSD: rsh.c,v 1.13 2000/01/31 14:19:34 itojun Exp $");
#endif
#endif /* not lint */
@@ -101,6 +101,8 @@
#ifdef IN_RCMD
int orcmd __P((char **, int, const char *,
const char *, const char *, int *));
+int orcmd_af __P((char **, int, const char *,
+ const char *, const char *, int *, int));
#endif
int
@@ -324,21 +326,21 @@
if (doencrypt)
errx(1, "the -x flag requires Kerberos authentication.");
#ifdef IN_RCMD
- rem = orcmd(&host, sp->s_port, locuser ? locuser :
+ rem = orcmd_af(&host, sp->s_port, locuser ? locuser :
#else
- rem = rcmd(&host, sp->s_port,
+ rem = rcmd_af(&host, sp->s_port,
#endif
name,
- user, args, &remerr);
+ user, args, &remerr, PF_UNSPEC);
}
#else /* KERBEROS */
#ifdef IN_RCMD
- rem = orcmd(&host, sp->s_port, locuser ? locuser :
+ rem = orcmd_af(&host, sp->s_port, locuser ? locuser :
#else
- rem = rcmd(&host, sp->s_port,
+ rem = rcmd_af(&host, sp->s_port,
#endif
- name, user, args, &remerr);
+ name, user, args, &remerr, PF_UNSPEC);
#endif /* KERBEROS */
(void)free(name);
Home |
Main Index |
Thread Index |
Old Index