MFH r190382,190416,190525:
- getaddrinfo(3) should accept numeric when ai_socktype is not specified in hint or hints is NULL.
- Add support for SCTP to getaddrinfo(3). Now, getaddrinfo(3) returns two SOCK_STREAMs, IPPROTO_TCP and IPPROTO_SCTP. It confuses some programs. If getaddrinfo(3) returns IPPROTO_SCTP when SOCK_STREAM is specified by hints.ai_socktype, at least Apache doesn't work. So, I made getaddrinfo(3) to return IPPROTO_SCTP with SOCK_STREAM only when IPPROTO_SCTP is specified explicitly by hints.ai_protocol.
- Query DNS only once per an address family.
Approved by: re (kib)