inetd needs "discard" service in /etc/services

Brooks Davis brooks at one-eyed-alien.net
Fri Mar 12 09:06:35 PST 2004


On Fri, Mar 12, 2004 at 10:51:13AM +0000, David Malone wrote:
> > I would like to commit the following patch.  It changes the port from
> > discard to syslog and documents the dependency.  I choose syslog because
> > it really does need to be in /etc/services on most machines since it
> > starts before NIS.  I'll also file a PR against inetd in hopes that
> > someone gets board enough to fix it some day.
> 
> getaddrinfo can also accept numeric service names (ie. port numbers
> in the case of UDP/TCP). I wonder if it would be better to just
> replace the service name with "1" or some such? I guess that would
> also fix your problem.

Nope, I tried that.  It turns out there's an annoying edge case that
makes it not work in this case (from line 496):

         * check for special cases.  (1) numeric servname is disallowed if
         * socktype/protocol are left unspecified. (2) servname is disallowed
         * for raw and other inet{,6} sockets. 

The real problem is that we should either not use getaddrinfo to make
sockaddrs or we should do it on demand when we actually have what we
need (i.e. a service name and protocol).

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20040312/77066ae5/attachment.bin


More information about the freebsd-hackers mailing list