diff options
author | guido <guido@FreeBSD.org> | 1998-05-14 20:26:16 +0000 |
---|---|---|
committer | guido <guido@FreeBSD.org> | 1998-05-14 20:26:16 +0000 |
commit | 70c2b190c2e5f9398684a66e0a53d2821b1f1fec (patch) | |
tree | 04dad5c134f5606226ecfa518068728860f4d557 /usr.sbin | |
parent | 7c2692687f121dfa47c898873a2f1f63caf5cb4f (diff) | |
download | FreeBSD-src-70c2b190c2e5f9398684a66e0a53d2821b1f1fec.zip FreeBSD-src-70c2b190c2e5f9398684a66e0a53d2821b1f1fec.tar.gz |
On request of Garrett, ad a way to specify that a service should be
reachable via T/TCP
Reviewed by: Garrett Wollman
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/inetd/inetd.8 | 5 | ||||
-rw-r--r-- | usr.sbin/inetd/inetd.c | 18 |
2 files changed, 20 insertions, 3 deletions
diff --git a/usr.sbin/inetd/inetd.8 b/usr.sbin/inetd/inetd.8 index bcdbb67..1a3538a 100644 --- a/usr.sbin/inetd/inetd.8 +++ b/usr.sbin/inetd/inetd.8 @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)inetd.8 8.3 (Berkeley) 4/13/94 -.\" $Id: inetd.8,v 1.18 1998/02/24 21:55:12 pst Exp $ +.\" $Id: inetd.8,v 1.19 1998/04/13 15:05:14 wollman Exp $ .\" .Dd February 7, 1996 .Dt INETD 8 @@ -210,6 +210,9 @@ Examples might be .Dq tcp or .Dq udp . +If it is desired that the service is reachable via T/TCP, one should +speicfy +.Dq tcp/ttcp . Rpc based services are specified with the .Dq rpc/tcp or diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index cd41030..4f19d0a 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)from: inetd.c 8.4 (Berkeley) 4/13/94"; #endif static const char rcsid[] = - "$Id: inetd.c,v 1.32 1998/05/08 19:15:44 guido Exp $"; + "$Id: inetd.c,v 1.33 1998/05/11 12:11:59 bde Exp $"; #endif /* not lint */ /* @@ -112,6 +112,7 @@ static const char rcsid[] = #include <sys/resource.h> #include <netinet/in.h> +#include <netinet/tcp.h> #include <arpa/inet.h> #include <rpc/rpc.h> #include <rpc/pmap_clnt.h> @@ -206,9 +207,11 @@ struct servtab { #define NORM_TYPE 0 #define MUX_TYPE 1 #define MUXPLUS_TYPE 2 +#define TTCP_TYPE 3 #define ISMUX(sep) (((sep)->se_type == MUX_TYPE) || \ ((sep)->se_type == MUXPLUS_TYPE)) #define ISMUXPLUS(sep) ((sep)->se_type == MUXPLUS_TYPE) +#define ISTTCP(sep) ((sep)->se_type == TTCP_TYPE) void chargen_dg __P((int, struct servtab *)); @@ -916,6 +919,10 @@ setsockopt(fd, SOL_SOCKET, opt, (char *)&on, sizeof (on)) syslog(LOG_ERR, "setsockopt (SO_PRIVSTATE): %m"); #endif #undef turnon + if (sep->se_type == TTCP_TYPE) + if (setsockopt(sep->se_fd, IPPROTO_TCP, TCP_NOPUSH, + (char *)&on, sizeof (on)) < 0) + syslog(LOG_ERR, "setsockopt (TCP_NOPUSH): %m"); if (bind(sep->se_fd, (struct sockaddr *)&sep->se_ctrladdr, sizeof (sep->se_ctrladdr)) < 0) { if (debug) @@ -1137,7 +1144,14 @@ more: sep->se_socktype = SOCK_RAW; else sep->se_socktype = -1; - sep->se_proto = newstr(sskip(&cp)); + + arg = sskip(&cp); + if (strcmp(arg, "tcp/ttcp") == 0) { + sep->se_type = TTCP_TYPE; + sep->se_proto = newstr("tcp"); + } else { + sep->se_proto = newstr(arg); + } if (strncmp(sep->se_proto, "rpc/", 4) == 0) { memmove(sep->se_proto, sep->se_proto + 4, strlen(sep->se_proto) + 1 - 4); |