diff options
author | Christoph Hellwig <hch@lst.de> | 2020-05-28 07:12:23 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-28 20:11:45 +0200 |
commit | 71c48eb81c9ecb6fed49dc33e7c9b621fdcb7bf8 (patch) | |
tree | f54423f3d3f22c039e685c108f98ea4d846bc9a0 /net/rds | |
parent | tcp: add tcp_sock_set_user_timeout (diff) | |
download | linux-71c48eb81c9ecb6fed49dc33e7c9b621fdcb7bf8.tar.xz linux-71c48eb81c9ecb6fed49dc33e7c9b621fdcb7bf8.zip |
tcp: add tcp_sock_set_keepidle
Add a helper to directly set the TCP_KEEP_IDLE 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/rds')
-rw-r--r-- | net/rds/tcp_listen.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c index 6f90ea077adc..79f9adc00811 100644 --- a/net/rds/tcp_listen.c +++ b/net/rds/tcp_listen.c @@ -52,10 +52,7 @@ int rds_tcp_keepalive(struct socket *sock) if (ret < 0) goto bail; - ret = kernel_setsockopt(sock, IPPROTO_TCP, TCP_KEEPIDLE, - (char *)&keepidle, sizeof(keepidle)); - if (ret < 0) - goto bail; + tcp_sock_set_keepidle(sock->sk, keepidle); /* KEEPINTVL is the interval between successive probes. We follow * the model in xs_tcp_finish_connecting() and re-use keepidle. |