mirror of
https://github.com/rofl0r/proxychains-ng.git
synced 2024-12-22 12:18:47 +00:00
proxy_getaddrinfo(): Fill in ai_socktype if requested
If the application specifies a protocol but not a socket type, normally getaddrinfo will select a corresponding protocol. Mimic this behavior in our implementation of the function as well. We only care about the case we're actually able to proxify (SOCK_STREAM / IPPROTO_TCP). Fixes proxifying pssh.
This commit is contained in:
parent
70629aaf25
commit
6abeb53e69
@ -1018,6 +1018,8 @@ int proxy_getaddrinfo(const char *node, const char *service, const struct addrin
|
|||||||
p->ai_socktype = hints->ai_socktype;
|
p->ai_socktype = hints->ai_socktype;
|
||||||
p->ai_flags = hints->ai_flags;
|
p->ai_flags = hints->ai_flags;
|
||||||
p->ai_protocol = hints->ai_protocol;
|
p->ai_protocol = hints->ai_protocol;
|
||||||
|
if(!p->ai_socktype && p->ai_protocol == IPPROTO_TCP)
|
||||||
|
p->ai_socktype = SOCK_STREAM;
|
||||||
} else {
|
} else {
|
||||||
#ifndef AI_V4MAPPED
|
#ifndef AI_V4MAPPED
|
||||||
#define AI_V4MAPPED 0
|
#define AI_V4MAPPED 0
|
||||||
|
Loading…
Reference in New Issue
Block a user