mirror of
https://github.com/rofl0r/proxychains-ng
synced 2025-01-06 21:02:55 +08:00
getaddrinfo: fix behaviour when node is null and !passive
according to the spec, if these 2 conditions hold, the name shall resolve to localhost. closes #292
This commit is contained in:
parent
de4460fbd1
commit
962373e5c6
@ -879,6 +879,10 @@ int proxy_getaddrinfo(const char *node, const char *service, const struct addrin
|
||||
goto err2;
|
||||
} else if(node) {
|
||||
af = ((struct sockaddr_in *) &space->sockaddr_space)->sin_family;
|
||||
} else if(!node && !(hints->ai_flags & AI_PASSIVE)) {
|
||||
af = ((struct sockaddr_in *) &space->sockaddr_space)->sin_family = AF_INET;
|
||||
memcpy(&((struct sockaddr_in *) &space->sockaddr_space)->sin_addr,
|
||||
(char[]){127,0,0,1}, 4);
|
||||
}
|
||||
if(service) mygetservbyname_r(service, NULL, &se_buf, buf, sizeof(buf), &se);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user