~/Projects/dsvpn
git clone https://code.lsong.org/dsvpn
Commit
- Commit
- 2ef7c9f36211bd46045d90331d8f1355f0ea0b66
- Author
- Frank Denis <[email protected]>
- Date
- 2019-08-04 20:58:05 +0200 +0200
- Diffstat
src/os.c | 4 ++++
Set TCP_USER_TIMEOUT on Linux
diff --git a/src/os.c b/src/os.c index b52ce131af6a6dd1fdcbf8459591628d62a4252d..da7209b08f93075c48222d706237c7089d796aaa 100644 --- a/src/os.c +++ b/src/os.c @@ -356,6 +356,10 @@ #if BUFFERBLOAT_CONTROL && defined(TCP_NOTSENT_LOWAT) (void) setsockopt(fd, IPPROTO_TCP, TCP_NOTSENT_LOWAT, (char *) (unsigned int[]){ NOTSENT_LOWAT }, sizeof(unsigned int)); #endif +#ifdef TCP_USER_TIMEOUT + (void) setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, (char *) (unsigned int[]){ TIMEOUT }, + sizeof(unsigned int)); +#endif #ifdef SO_MARK (void) setsockopt(fd, SOL_SOCKET, SO_MARK, (char *) (unsigned int[]){ 42069U }, sizeof(unsigned int));