diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c index 247b4ee4513..2dbc8d119ab 100644 --- a/sys/cam/ctl/ctl_frontend_iscsi.c +++ b/sys/cam/ctl/ctl_frontend_iscsi.c @@ -993,7 +993,7 @@ cfiscsi_callout(void *context) #ifdef ICL_KERNEL_PROXY if (cs->cs_waiting_for_ctld || cs->cs_login_phase) { - if (cs->cs_timeout > login_timeout) { + if (login_timeout > 0 && cs->cs_timeout > login_timeout) { CFISCSI_SESSION_WARN(cs, "login timed out after " "%d seconds; dropping connection", cs->cs_timeout); cfiscsi_session_terminate(cs); diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index c08abf94843..f3961ffbcf3 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -538,7 +538,7 @@ iscsi_callout(void *context) is->is_timeout++; if (is->is_waiting_for_iscsid) { - if (is->is_timeout > iscsid_timeout) { + if (iscsid_timeout > 0 && is->is_timeout > iscsid_timeout) { ISCSI_SESSION_WARN(is, "timed out waiting for iscsid(8) " "for %d seconds; reconnecting", is->is_timeout); @@ -548,7 +548,7 @@ iscsi_callout(void *context) } if (is->is_login_phase) { - if (is->is_timeout > login_timeout) { + if (login_timeout > 0 && is->is_timeout > login_timeout) { ISCSI_SESSION_WARN(is, "login timed out after %d seconds; " "reconnecting", is->is_timeout); reconnect_needed = true; @@ -556,6 +556,16 @@ iscsi_callout(void *context) goto out; } + if (ping_timeout <= 0) { + /* + * Pings are disabled. Don't send NOP-Out in this case. + * Reset the timeout, to avoid triggering reconnection, + * should the user decide to reenable them. + */ + is->is_timeout = 0; + goto out; + } + if (is->is_timeout >= ping_timeout) { ISCSI_SESSION_WARN(is, "no ping reply (NOP-In) after %d seconds; " "reconnecting", ping_timeout);