diff options
author | dg <dg@FreeBSD.org> | 1995-10-15 03:40:57 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-10-15 03:40:57 +0000 |
commit | 533954be6383ca0c580ac96dc0454b27cf5a65ef (patch) | |
tree | 05e547c447da1c852c04cfd202db75e4ae5fd2bb /libexec/rlogind | |
parent | 73eed4fd953b8913d7fe3aede1b690de3226ca1e (diff) | |
download | FreeBSD-src-533954be6383ca0c580ac96dc0454b27cf5a65ef.zip FreeBSD-src-533954be6383ca0c580ac96dc0454b27cf5a65ef.tar.gz |
Added a -D option to set the TCP_NODELAY socket option. This improves
responsiveness at the expense of some additional network traffic.
Diffstat (limited to 'libexec/rlogind')
-rw-r--r-- | libexec/rlogind/rlogind.8 | 5 | ||||
-rw-r--r-- | libexec/rlogind/rlogind.c | 17 |
2 files changed, 17 insertions, 5 deletions
diff --git a/libexec/rlogind/rlogind.8 b/libexec/rlogind/rlogind.8 index 9c19933..68b89a6 100644 --- a/libexec/rlogind/rlogind.8 +++ b/libexec/rlogind/rlogind.8 @@ -39,7 +39,7 @@ .Nd remote login server .Sh SYNOPSIS .Nm rlogind -.Op Fl aln +.Op Fl Daln .Sh DESCRIPTION .Nm Rlogind is the server for the @@ -50,6 +50,9 @@ with authentication based on privileged port numbers from trusted hosts. Options supported by .Nm rlogind : .Bl -tag -width Ds +.It Fl D +Set TCP_NODELAY socket option. This improves responsiveness at the expense of +some additional network traffic. .It Fl a Ask hostname for verification. .It Fl l diff --git a/libexec/rlogind/rlogind.c b/libexec/rlogind/rlogind.c index 37a974d..b93f1ed 100644 --- a/libexec/rlogind/rlogind.c +++ b/libexec/rlogind/rlogind.c @@ -61,6 +61,7 @@ static char sccsid[] = "@(#)rlogind.c 8.1 (Berkeley) 6/4/93"; #include <netinet/in.h> #include <netinet/in_systm.h> #include <netinet/ip.h> +#include <netinet/tcp.h> #include <arpa/inet.h> #include <netdb.h> @@ -89,9 +90,9 @@ u_char tick_buf[sizeof(KTEXT_ST)]; Key_schedule schedule; int doencrypt, retval, use_kerberos, vacuous; -#define ARGSTR "alnkvx" +#define ARGSTR "Dalnkvx" #else -#define ARGSTR "aln" +#define ARGSTR "Daln" #endif /* KERBEROS */ char *env[2]; @@ -101,6 +102,7 @@ static char term[64] = "TERM="; #define ENVSIZE (sizeof("TERM=")-1) /* skip null for concatenation */ int keepalive = 1; int check_all = 0; +int no_delay; struct passwd *pwd; @@ -131,6 +133,9 @@ main(argc, argv) opterr = 0; while ((ch = getopt(argc, argv, ARGSTR)) != EOF) switch (ch) { + case 'D': + no_delay = 1; + break; case 'a': check_all = 1; break; @@ -176,9 +181,13 @@ main(argc, argv) if (keepalive && setsockopt(0, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof (on)) < 0) syslog(LOG_WARNING, "setsockopt (SO_KEEPALIVE): %m"); + if (no_delay && + setsockopt(0, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) < 0) + syslog(LOG_WARNING, "setsockopt (TCP_NODELAY): %m"); on = IPTOS_LOWDELAY; if (setsockopt(0, IPPROTO_IP, IP_TOS, (char *)&on, sizeof(int)) < 0) syslog(LOG_WARNING, "setsockopt (IP_TOS): %m"); + doit(0, &from); } @@ -715,9 +724,9 @@ void usage() { #ifdef KERBEROS - syslog(LOG_ERR, "usage: rlogind [-aln] [-k | -v]"); + syslog(LOG_ERR, "usage: rlogind [-Daln] [-k | -v]"); #else - syslog(LOG_ERR, "usage: rlogind [-aln]"); + syslog(LOG_ERR, "usage: rlogind [-Daln]"); #endif } |