- for (p = addr; *p && (dots <= 3); p++) {
- if (*p == '.')
- dots++;
- }
- if (dots > 3) {
- /* more than 4 parts to IP address, must be ipv6 */
- ssp = (struct sockaddr_storage *) &sin6;
- ss_len = sizeof sin6;
- memset(ssp, 0, ss_len);
- inet_pton(AF_INET6, addr, &sin6.sin6_addr);
- sin6.sin6_family = AF_INET6;
- } else
+ memset(&hint, 0, sizeof hint);
+
+#ifdef AI_NUMERICHOST
+ hint.ai_flags = AI_NUMERICHOST;