tcp: add tcp_sock_set_keepintvl

Add a helper to directly set the TCP_KEEPINTVL 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>
Bu işleme şunda yer alıyor:
Christoph Hellwig
2020-05-28 07:12:24 +02:00
işlemeyi yapan: David S. Miller
ebeveyn 71c48eb81c
işleme d41ecaac90
4 değiştirilmiş dosya ile 15 ekleme ve 5 silme

Dosyayı Görüntüle

@@ -53,12 +53,10 @@ int rds_tcp_keepalive(struct socket *sock)
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.
*/
ret = kernel_setsockopt(sock, IPPROTO_TCP, TCP_KEEPINTVL,
(char *)&keepidle, sizeof(keepidle));
tcp_sock_set_keepintvl(sock->sk, keepidle);
bail:
return ret;
}