[Drbd-dev] [PATCH 5/8] drbd: use sock_set_keepalive() instead of kernel_setsockopt()

Michael D Labriola michael.d.labriola at gmail.com
Sun Dec 13 06:07:01 CET 2020


Looks like the rest of the code has been updated to use 5.8's sock_set_*
and tcp_set_* functions, but we've missed this one case.

Signed-off-by: Michael D Labriola <michael.d.labriola at gmail.com>
---
 drbd/drbd_transport_tcp.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drbd/drbd_transport_tcp.c b/drbd/drbd_transport_tcp.c
index 203dc4e0..3b1d4273 100644
--- a/drbd/drbd_transport_tcp.c
+++ b/drbd/drbd_transport_tcp.c
@@ -883,7 +883,6 @@ static int dtt_connect(struct drbd_transport *transport)
 	struct socket *dsocket, *csocket;
 	struct net_conf *nc;
 	int timeout, err;
-	int one = 1;
 	bool ok;
 
 	dsocket = NULL;
@@ -1065,9 +1064,7 @@ randomize:
 	dsocket->sk->sk_sndtimeo = timeout;
 	csocket->sk->sk_sndtimeo = timeout;
 
-	err = kernel_setsockopt(dsocket, SOL_SOCKET, SO_KEEPALIVE, (char *)&one, sizeof(one));
-	if (err)
-		tr_warn(transport, "Failed to enable SO_KEEPALIVE %d\n", err);
+	sock_set_keepalive(dsocket->sk);
 
 	return 0;
 
-- 
2.17.1



More information about the drbd-dev mailing list