diff options
author | brooks <brooks@FreeBSD.org> | 2004-04-20 23:34:39 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2004-04-20 23:34:39 +0000 |
commit | b5d0f5636118aa73b9360cde461a82e0c05557df (patch) | |
tree | 31e336bff9fd00ecf3f9adf1ae375b5dd2cfb19c /usr.sbin | |
parent | 2f31d4ad3c6b94274bb8e55535e7bc9f9004cd9f (diff) | |
download | FreeBSD-src-b5d0f5636118aa73b9360cde461a82e0c05557df.zip FreeBSD-src-b5d0f5636118aa73b9360cde461a82e0c05557df.tar.gz |
Remove the requirement that the "discard" service be defined in the
services database. Now only services that are actually used need to be
defined.
Submitted by: ume
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/inetd/inetd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index 331f873..a6fa37a 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -403,12 +403,16 @@ main(int argc, char **argv) * getaddrinfo(). But getaddrinfo() requires at least one of * hostname or servname is non NULL. * So when hostname is NULL, set dummy value to servname. + * Since getaddrinfo() doesn't accept numeric servname, and + * we doesn't use ai_socktype of struct addrinfo returned + * from getaddrinfo(), we set dummy value to ai_socktype. */ - servname = (hostname == NULL) ? "discard" /* dummy */ : NULL; + servname = (hostname == NULL) ? "0" /* dummy */ : NULL; bzero(&hints, sizeof(struct addrinfo)); hints.ai_flags = AI_PASSIVE; hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; /* dummy */ error = getaddrinfo(hostname, servname, &hints, &res); if (error != 0) { syslog(LOG_ERR, "-a %s: %s", hostname, gai_strerror(error)); |