aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-05-28 07:12:22 +0200
committerDavid S. Miller <davem@davemloft.net>2020-05-28 11:11:45 -0700
commitc488aeadcbd002a992593e6090d54e8ac27c4310 (patch)
tree88fa0208206176037a7bd7fba3784e92c00e6988 /net/ipv4
parenttcp: add tcp_sock_set_syncnt (diff)
downloadlinux-dev-c488aeadcbd002a992593e6090d54e8ac27c4310.tar.xz
linux-dev-c488aeadcbd002a992593e6090d54e8ac27c4310.zip
tcp: add tcp_sock_set_user_timeout
Add a helper to directly set the TCP_USER_TIMEOUT sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index d2c67ae1da07..0004bd9ae7b0 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2893,6 +2893,14 @@ int tcp_sock_set_syncnt(struct sock *sk, int val)
}
EXPORT_SYMBOL(tcp_sock_set_syncnt);
+void tcp_sock_set_user_timeout(struct sock *sk, u32 val)
+{
+ lock_sock(sk);
+ inet_csk(sk)->icsk_user_timeout = val;
+ release_sock(sk);
+}
+EXPORT_SYMBOL(tcp_sock_set_user_timeout);
+
/*
* Socket option code for TCP.
*/