diff options
author | Brooks Davis <brooks@FreeBSD.org> | 2004-04-20 23:34:39 +0000 |
---|---|---|
committer | Brooks Davis <brooks@FreeBSD.org> | 2004-04-20 23:34:39 +0000 |
commit | 44501e8cfd0572aee7c6f894353f83a037d514f4 (patch) | |
tree | 31e336bff9fd00ecf3f9adf1ae375b5dd2cfb19c /usr.sbin/inetd/inetd.c | |
parent | 59fb7e543f8ae1b32321a7af9501d5fc3032004e (diff) | |
download | src-44501e8cfd0572aee7c6f894353f83a037d514f4.tar.gz src-44501e8cfd0572aee7c6f894353f83a037d514f4.zip |
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
Notes
Notes:
svn path=/head/; revision=128501
Diffstat (limited to 'usr.sbin/inetd/inetd.c')
-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 331f873928f0..a6fa37a1eda4 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)); |