diff --git a/tpws/helpers.c b/tpws/helpers.c index c1b17bf..8d71403 100644 --- a/tpws/helpers.c +++ b/tpws/helpers.c @@ -19,6 +19,9 @@ #endif #include "helpers.h" +#ifdef __linux__ +#include +#endif #include "linux_compat.h" int unique_size_t(size_t *pu, int ct) diff --git a/tpws/linux_compat.h b/tpws/linux_compat.h index 8936c49..5695292 100644 --- a/tpws/linux_compat.h +++ b/tpws/linux_compat.h @@ -1,6 +1,14 @@ #ifdef __linux__ -#include +#include + +#ifndef TCP_USER_TIMEOUT +#define TCP_USER_TIMEOUT 18 +#endif + +#ifndef IP6T_SO_ORIGINAL_DST + #define IP6T_SO_ORIGINAL_DST 80 +#endif // workaround for old headers diff --git a/tpws/redirect.c b/tpws/redirect.c index ecfc8b2..58491ec 100644 --- a/tpws/redirect.c +++ b/tpws/redirect.c @@ -9,12 +9,10 @@ #include "params.h" #include "helpers.h" +#include "linux_compat.h" #ifdef __linux__ #include - #ifndef IP6T_SO_ORIGINAL_DST - #define IP6T_SO_ORIGINAL_DST 80 - #endif #endif diff --git a/tpws/tpws_conn.c b/tpws/tpws_conn.c index 5c54ebd..b4056ee 100644 --- a/tpws/tpws_conn.c +++ b/tpws/tpws_conn.c @@ -23,6 +23,7 @@ #include "socks.h" #include "helpers.h" #include "hostlist.h" +#include "linux_compat.h" // keep separate legs counter. counting every time thousands of legs can consume cpu static int legs_local, legs_remote;