summaryrefslogtreecommitdiffstats
path: root/libexec/rshd/rshd.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1998-12-01 23:27:24 +0000
committerdg <dg@FreeBSD.org>1998-12-01 23:27:24 +0000
commit24689f2c761b81d2198221b7096cb6ff90f7b3ca (patch)
tree7d2a806eab4ea62c57eb19d7ff0d9573b02584c5 /libexec/rshd/rshd.c
parent557d938d623b77331ee8b40dc2511670babb33d3 (diff)
downloadFreeBSD-src-24689f2c761b81d2198221b7096cb6ff90f7b3ca.zip
FreeBSD-src-24689f2c761b81d2198221b7096cb6ff90f7b3ca.tar.gz
Added a -D option to turn on TCP_NODELAY.
Diffstat (limited to 'libexec/rshd/rshd.c')
-rw-r--r--libexec/rshd/rshd.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/libexec/rshd/rshd.c b/libexec/rshd/rshd.c
index da03189..1f3278a 100644
--- a/libexec/rshd/rshd.c
+++ b/libexec/rshd/rshd.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static const char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94";
#endif
static const char rcsid[] =
- "$Id: rshd.c,v 1.20 1997/12/02 12:30:04 charnier Exp $";
+ "$Id: rshd.c,v 1.21 1998/05/05 00:28:51 rnordier Exp $";
#endif /* not lint */
/*
@@ -61,6 +61,7 @@ static const char rcsid[] =
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
+#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
@@ -82,6 +83,7 @@ int keepalive = 1;
int check_all;
int log_success; /* If TRUE, log all successful accesses */
int sent_null;
+int no_delay;
void doit __P((struct sockaddr_in *));
void error __P((const char *, ...));
@@ -95,13 +97,13 @@ void usage __P((void));
#include <krb.h>
#define VERSION_SIZE 9
#define SECURE_MESSAGE "This rsh session is using DES encryption for all transmissions.\r\n"
-#define OPTIONS "alnkvxL"
+#define OPTIONS "alnkvxDL"
char authbuf[sizeof(AUTH_DAT)];
char tickbuf[sizeof(KTEXT_ST)];
int doencrypt, use_kerberos, vacuous;
Key_schedule schedule;
#else
-#define OPTIONS "alnL"
+#define OPTIONS "alnDL"
#endif
int
@@ -143,6 +145,9 @@ main(argc, argv)
break;
#endif
#endif
+ case 'D':
+ no_delay = 1;
+ break;
case 'L':
log_success = 1;
break;
@@ -182,6 +187,9 @@ main(argc, argv)
if (setsockopt(0, SOL_SOCKET, SO_LINGER, (char *)&linger,
sizeof (linger)) < 0)
syslog(LOG_WARNING, "setsockopt (SO_LINGER): %m");
+ if (no_delay &&
+ setsockopt(0, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) < 0)
+ syslog(LOG_WARNING, "setsockopt (TCP_NODELAY): %m");
doit(&from);
/* NOTREACHED */
return(0);
OpenPOWER on IntegriCloud