Subject: bin/20817: inetd doesn't accept tcp,rcvbuf=16384 et al.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <itohy@netbsd.org>
List: netbsd-bugs
Date: 03/20/2003 19:00:05
>Number: 20817
>Category: bin
>Synopsis: inetd doesn't accept tcp,rcvbuf=16384 et al.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Mar 20 02:01:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: ITOH Yasufumi
>Release: NetBSD 1.6L
>Organization:
>Environment:
System: NetBSD pino.my.domain 1.6L NetBSD 1.6L (PINO) #352: Wed Jan 15 01:30:30 JST 2003 itohy@pino.my.domain:/w/src/sys/arch/i386/compile/PINO i386
Architecture: i386
Machine: i386
>Description:
The inetd(8) manual page mentions TCP buffer size options,
rcvbuf and sndbuf.
inetd(8) reads:
> The socket buffer sizes are specified by appending their
> values to the protocol specification as follows:
>
> tcp,rcvbuf=16384
> tcp,sndbuf=64k
> tcp,rcvbuf=64k,sndbuf=1m
However, the first form (no suffix) is not accepted.
>How-To-Repeat:
Use the following line (for example) in /etc/inetd.conf
discard stream tcp,rcvbuf=16384 nowait nobody internal
and see the following error mesage in /var/log/messages.
inetd[244]: discard: malformed buffer size option `16384'
>Fix:
Here's suggested fix.
--- inetd.c.orig Wed Feb 19 19:24:56 2003
+++ inetd.c Thu Mar 20 13:01:35 2003
@@ -1415,12 +1415,16 @@
MALFORMED(arg); \
val = strtol((arg), &cp0, 10); \
if (cp0 != NULL) { \
- if (cp0[1] != '\0') \
+ if (cp0[0] != '\0') \
+ ; \
+ else if (cp0[1] != '\0') \
MALFORMED((arg)); \
- if (cp0[0] == 'k') \
+ else if (cp0[0] == 'k') \
val *= 1024; \
- if (cp0[0] == 'm') \
+ else if (cp0[0] == 'm') \
val *= 1024 * 1024; \
+ else \
+ MALFORMED((arg)); \
} \
if (val < 1) { \
syslog(LOG_ERR, "%s: invalid buffer size `%s'", \
>Release-Note:
>Audit-Trail:
>Unformatted: