Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/rofl0r/proxychains-ng.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Panteleev <git@cy.md>2022-01-22 21:54:33 +0300
committerrofl0r <rofl0r@users.noreply.github.com>2022-01-22 23:05:47 +0300
commit6abeb53e69193966329df3beeae857051cd329b6 (patch)
tree96f8fdf3b98d5101483890afa10e051037b18a15
parent70629aaf2548b4ca49cf0508628d07337fc7b989 (diff)
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.
-rw-r--r--src/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index 18591ac..3dbf624 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1018,6 +1018,8 @@ int proxy_getaddrinfo(const char *node, const char *service, const struct addrin
p->ai_socktype = hints->ai_socktype;
p->ai_flags = hints->ai_flags;
p->ai_protocol = hints->ai_protocol;
+ if(!p->ai_socktype && p->ai_protocol == IPPROTO_TCP)
+ p->ai_socktype = SOCK_STREAM;
} else {
#ifndef AI_V4MAPPED
#define AI_V4MAPPED 0