tcp: add tcp_sock_set_keepcnt
Add a helper to directly set the TCP_KEEPCNT 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>
This commit is contained in:

committed by
David S. Miller

parent
d41ecaac90
commit
480aeb9639
@@ -2109,8 +2109,7 @@ static void xs_tcp_set_socket_timeouts(struct rpc_xprt *xprt,
|
||||
sock_set_keepalive(sock->sk);
|
||||
tcp_sock_set_keepidle(sock->sk, keepidle);
|
||||
tcp_sock_set_keepintvl(sock->sk, keepidle);
|
||||
kernel_setsockopt(sock, SOL_TCP, TCP_KEEPCNT,
|
||||
(char *)&keepcnt, sizeof(keepcnt));
|
||||
tcp_sock_set_keepcnt(sock->sk, keepcnt);
|
||||
|
||||
/* TCP user timeout (see RFC5482) */
|
||||
tcp_sock_set_user_timeout(sock->sk, timeo);
|
||||
|
Reference in New Issue
Block a user