We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subject says it all: getaddrinfo() returns positive values in case of errors. These get returned to the caller:
res = getaddrinfo(host, portnum, &hints, &addr); if (res == 0) { int addrlen = addr->ai_addrlen; /* Grab first result */ memcpy(out, addr->ai_addr, addr->ai_addrlen); freeaddrinfo(addr); return addrlen; } return res;
But the caller check for negative values, e.g.:
res = get_addr("resolver1.opendns.com", 53, AF_INET, 0, &query.destination); if (res < 0) return 1; ... dns4addr_len = get_addr(listen_ip4, port, AF_INET, AI_PASSIVE, &dns4addr); if (dns4addr_len < 0) { ... int addr6_res = get_addr(listen_ip6, port, AF_INET6, AI_PASSIVE, &dns6addr); if (addr6_res < 0) {
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Subject says it all:
getaddrinfo() returns positive values in case of errors. These get returned
to the caller:
But the caller check for negative values, e.g.:
The text was updated successfully, but these errors were encountered: