1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

On request of Garrett, ad a way to specify that a service should be

reachable via T/TCP
Reviewed by:	Garrett Wollman
This commit is contained in:
Guido van Rooij 1998-05-14 20:26:16 +00:00
parent c3f80129dc
commit c6c38f1d7f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=36042
2 changed files with 20 additions and 3 deletions

View File

@ -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

View File

@ -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 @@ getconfigent()
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);