aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/rlogin/rlogin.c
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1995-05-03 06:25:56 +0000
committerDavid Greenman <dg@FreeBSD.org>1995-05-03 06:25:56 +0000
commit8d34651b6c76da47148db090fc1423cc222798e5 (patch)
tree1294224d1adaea563521b97c874659babd8bc5ac /usr.bin/rlogin/rlogin.c
parent6de98b5d98878411772eef1caa0efe5a2cc77498 (diff)
downloadsrc-8d34651b6c76da47148db090fc1423cc222798e5.tar.gz
src-8d34651b6c76da47148db090fc1423cc222798e5.zip
Added a "-D" option to set the TCP_NODELAY socket option.
Notes
Notes: svn path=/head/; revision=8232
Diffstat (limited to 'usr.bin/rlogin/rlogin.c')
-rw-r--r--usr.bin/rlogin/rlogin.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c
index d9379c2550ed..bdd60a311e5f 100644
--- a/usr.bin/rlogin/rlogin.c
+++ b/usr.bin/rlogin/rlogin.c
@@ -53,6 +53,7 @@ static char sccsid[] = "@(#)rlogin.c 8.1 (Berkeley) 6/6/93";
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
+#include <netinet/tcp.h>
#include <errno.h>
#include <fcntl.h>
@@ -150,10 +151,10 @@ main(argc, argv)
struct servent *sp;
struct sgttyb ttyb;
long omask;
- int argoff, ch, dflag, one, uid;
+ int argoff, ch, dflag, Dflag, one, uid;
char *host, *p, *user, term[1024];
- argoff = dflag = 0;
+ argoff = dflag = Dflag = 0;
one = 1;
host = user = NULL;
@@ -172,15 +173,18 @@ main(argc, argv)
}
#ifdef KERBEROS
-#define OPTIONS "8EKLde:k:l:x"
+#define OPTIONS "8DEKLde:k:l:x"
#else
-#define OPTIONS "8EKLde:l:"
+#define OPTIONS "8DEKLde:l:"
#endif
while ((ch = getopt(argc - argoff, argv + argoff, OPTIONS)) != EOF)
switch(ch) {
case '8':
eight = 1;
break;
+ case 'D':
+ Dflag = 1;
+ break;
case 'E':
noescape = 1;
break;
@@ -337,6 +341,10 @@ try_connect:
setsockopt(rem, SOL_SOCKET, SO_DEBUG, &one, sizeof(one)) < 0)
(void)fprintf(stderr, "rlogin: setsockopt: %s.\n",
strerror(errno));
+ if (Dflag &&
+ setsockopt(rem, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)) < 0)
+ perror("rlogin: setsockopt NODELAY (ignored)");
+
one = IPTOS_LOWDELAY;
if (setsockopt(rem, IPPROTO_IP, IP_TOS, (char *)&one, sizeof(int)) < 0)
perror("rlogin: setsockopt TOS (ignored)");