Set SO_KEEPALIVE before TCP_USER_TIMEOUT
For TCP_USER_TIMEOUT to work it seems to be necessary that SO_KEEPALIVE is enabled. RFC5482 section 4.2 also says that the TCP_USER_TIMEOUT has to be less than the keepalive timeout. This means less than 30000 ms in the current libiscsi default settings for TCP keepalives.
This commit is contained in:
@@ -160,13 +160,11 @@ iscsi_connect_async(struct iscsi_context *iscsi, const char *portal,
|
|||||||
|
|
||||||
set_nonblocking(iscsi->fd);
|
set_nonblocking(iscsi->fd);
|
||||||
|
|
||||||
|
iscsi_set_tcp_keepalive(iscsi, 30, 3, 30);
|
||||||
|
|
||||||
if (iscsi->tcp_user_timeout > 0) {
|
if (iscsi->tcp_user_timeout > 0) {
|
||||||
set_tcp_user_timeout(iscsi);
|
set_tcp_user_timeout(iscsi);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
iscsi_set_tcp_keepalive(iscsi, 30, 3, 30);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (connect(iscsi->fd, ai->ai_addr, socksize) != 0
|
if (connect(iscsi->fd, ai->ai_addr, socksize) != 0
|
||||||
&& errno != EINPROGRESS) {
|
&& errno != EINPROGRESS) {
|
||||||
|
|||||||
Reference in New Issue
Block a user