1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-13 23:13:24 +00:00

Catch service resolution failure

This commit is contained in:
Gerhard Rieger 2021-10-26 13:34:38 +02:00
parent 3efbf71430
commit ea5beb8e75
3 changed files with 56 additions and 0 deletions

View file

@ -238,6 +238,16 @@ int xiogetaddrinfo(const char *node, const char *service,
continue;
}
if (error_num == EAI_SERVICE && protocol != 0) {
if (hints.ai_protocol == 0) {
Error7("getaddrinfo\"%s\", \"%s\", {%d,%d,%d,%d}, {}): %s",
node?node:"NULL", service?service:"NULL",
hints.ai_flags, hints.ai_family,
hints.ai_socktype, hints.ai_protocol,
gai_strerror(error_num));
if (res != NULL) freeaddrinfo(res);
if (numnode) free(numnode);
return STAT_NORETRY;
}
hints.ai_protocol = 0;
continue;
}