1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-15 07:33:25 +00:00

Passive addresses like TCP-LISTEN with empty port bound to random

This commit is contained in:
Gerhard Rieger 2015-01-12 22:21:36 +01:00
parent 0ab324b173
commit ad524a56b7
3 changed files with 51 additions and 0 deletions

View file

@ -149,6 +149,9 @@ int xiogetaddrinfo(const char *node, const char *service,
memset(sau, 0, *socklen);
sau->soa.sa_family = family;
if (service && service[0]=='\0') {
Error("empty port/service");
}
/* if service is numeric we don't want to have a lookup (might take long
with NIS), so we handle this specially */
if (service && isdigit(service[0]&0xff)) {