diff options
-rw-r--r-- | src/kernel/net.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/kernel/net.c b/src/kernel/net.c index b229164..7058b8b 100644 --- a/src/kernel/net.c +++ b/src/kernel/net.c @@ -608,7 +608,6 @@ static int __dnbd3_socket_connect(struct dnbd3_sock *sock, struct dnbd3_server *server) { int result = 0; - struct timeval timeout; if (server->host.port == 0 || server->host.type == 0) { error_sock(sock, "host or port not set"); @@ -619,8 +618,6 @@ static int __dnbd3_socket_connect(struct dnbd3_sock *sock, return -EIO; } - timeout.tv_sec = SOCKET_TIMEOUT_CLIENT_DATA; - timeout.tv_usec = 0; result = dnbd3_sock_create(server->host.type, SOCK_STREAM, IPPROTO_TCP, &sock->sock); if (result < 0) { @@ -628,10 +625,8 @@ static int __dnbd3_socket_connect(struct dnbd3_sock *sock, goto error; } - kernel_setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout, - sizeof(timeout)); - kernel_setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, - sizeof(timeout)); + sock->sock->sk->sk_rcvtimeo = sock->sock->sk->sk_sndtimeo + = SOCKET_TIMEOUT_CLIENT_DATA * HZ; sock->sock->sk->sk_allocation = GFP_NOIO; if (server->host.type == HOST_IP4) { struct sockaddr_in sin; |