From 674564db7274f9003ac6b2b87e2e77515a64bdcd Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Tue, 8 Sep 2020 18:52:21 +0200 Subject: [PATCH] net: use TCP_USER_TIMEOUT --- kernel/mars_net.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/mars_net.c b/kernel/mars_net.c index 39062afd..1e811e81 100644 --- a/kernel/mars_net.c +++ b/kernel/mars_net.c @@ -202,6 +202,7 @@ void _set_socketopts(struct socket *sock, struct mars_tcp_params *params, bool i .tv_sec = params->tcp_timeout, }; #endif + unsigned int user_timeout = params->tcp_timeout * 1000; int x_true = 1; /* TODO: improve this by a table-driven approach @@ -229,6 +230,7 @@ void _set_socketopts(struct socket *sock, struct mars_tcp_params *params, bool i _setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, t); _setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, t); #endif + _setsockopt(sock, IPPROTO_TCP, TCP_USER_TIMEOUT, user_timeout); } int mars_create_socket(struct mars_socket *msock,