diff --git a/src/libproxychains.c b/src/libproxychains.c index 07a9865..c9eaeaa 100644 --- a/src/libproxychains.c +++ b/src/libproxychains.c @@ -482,9 +482,12 @@ struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type) { return NULL; } +#ifndef MSG_FASTOPEN +# define MSG_FASTOPEN 0x20000000 +#endif + ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen) { -#ifdef MSG_FASTOPEN if (flags & MSG_FASTOPEN) { if (!connect(sockfd, dest_addr, addrlen) && errno != EINPROGRESS) { return -1; @@ -493,6 +496,5 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, addrlen = 0; flags &= ~MSG_FASTOPEN; } -#endif return true_sendto(sockfd, buf, len, flags, dest_addr, addrlen); } diff --git a/tests/test_sendto.c b/tests/test_sendto.c index 77d2e9c..57b008f 100644 --- a/tests/test_sendto.c +++ b/tests/test_sendto.c @@ -7,6 +7,10 @@ #include #include +#ifndef MSG_FASTOPEN +# define MSG_FASTOPEN 0x20000000 +#endif + void error(const char *msg) { perror(msg);