}
addrinfo hints;
- hints.ai_flags = AI_NUMERICSERV;
+ hints.ai_flags = 0;
hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = 0;
hints.ai_canonname = nullptr;
hints.ai_next = nullptr;
- /* getaddrinfo requires a port number, but is quite happy to accept
- invalid ones. So don't rely on it. */
- if (int err = getaddrinfo (name, "0", &hints, &addrs))
+ if (int err = getaddrinfo (name, nullptr, &hints, &addrs))
{
errstr = gai_strerror (err);
// What's the best errno to set?