about summary refs log tree commit diff
path: root/src/network/getaddrinfo.c
Commit message (Collapse)AuthorAgeFilesLines
* fix getaddrinfo to accept port 0 (zero)Rich Felker2012-09-221-2/+2
| | | | | | | | new behavior can be summarized as: inputs that parse completely as a decimal number are treated as one, and rejected only if the result is out of 16-bit range. inputs that do not parse as a decimal number (where strtoul leaves anything left over in the input) are searched in /etc/services.
* use restrict everywhere it's required by c99 and/or posix 2008Rich Felker2012-09-061-1/+1
| | | | | | | | to deal with the fact that the public headers may be used with pre-c99 compilers, __restrict is used in place of restrict, and defined appropriately for any supported compiler. we also avoid the form [restrict] since older versions of gcc rejected it due to a bug in the original c99 standard, and instead use the form *restrict.
* remove scanf dependency from getaddrinfo /etc/services supportRich Felker2012-07-221-5/+4
|
* getaddrinfo /etc/services lookup supportRich Felker2012-07-221-3/+16
|
* improve name lookup performance in corner casesRich Felker2012-04-011-1/+1
| | | | | | | | | | | the buffer in getaddrinfo really only matters when /etc/hosts is huge, but in that case, the huge number of syscalls resulting from a tiny buffer would seriously impact the performance of every name lookup. the buffer in __dns.c has also been enlarged a bit so that typical resolv.conf files will fit fully in the buffer. there's no need to make it so large as to dominate the syscall overhead for large files, because resolv.conf should never be large.
* port numbers should always be interpreted as decimalRich Felker2011-08-011-1/+1
| | | | | | | | | | | per POSIX and RFC 3493: If the specified address family is AF_INET, AF_INET6, or AF_UNSPEC, the service can be specified as a string specifying a decimal port number. 021 is a valid decimal number, therefore, interpreting it as octal seems to be non-conformant.
* disallow blank strings as service or host nameRich Felker2011-04-201-0/+3
|
* return the requested string as the "canonical name" for numeric addressesRich Felker2011-04-081-0/+1
| | | | | | | | previously NULL was returned in ai_canonname, resulting in crashes in some callers. this behavior was incorrect. note however that the new behavior differs from glibc, which performs reverse dns lookups. POSIX is very clear that a reverse DNS lookup must not be performed for numeric addresses.
* fix all implicit conversion between signed/unsigned pointersRich Felker2011-03-251-1/+1
| | | | | | | sadly the C language does not specify any such implicit conversion, so this is not a matter of just fixing warnings (as gcc treats it) but actual errors. i would like to revisit a number of these changes and possibly revise the types used to reduce the number of casts required.
* initial check-in, version 0.5.0 v0.5.0Rich Felker2011-02-121-0/+224