Call the ICL module's handoff method even when using ICL proxy.

The upcoming iSER code uses this.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
trasz 2016-05-20 17:38:51 +00:00
parent 8692d6dbaf
commit 60ceac7f6f
2 changed files with 27 additions and 14 deletions

View File

@ -1327,6 +1327,23 @@ icl_soft_conn_handoff(struct icl_conn *ic, int fd)
ICL_CONN_LOCK_ASSERT_NOT(ic);
#ifdef ICL_KERNEL_PROXY
/*
* We're transitioning to Full Feature phase, and we don't
* really care.
*/
if (fd == 0) {
ICL_CONN_LOCK(ic);
if (ic->ic_socket == NULL) {
ICL_CONN_UNLOCK(ic);
ICL_WARN("proxy handoff without connect");
return (EINVAL);
}
ICL_CONN_UNLOCK(ic);
return (0);
}
#endif
/*
* Steal the socket from userland.
*/

View File

@ -1415,21 +1415,17 @@ iscsi_ioctl_daemon_handoff(struct iscsi_softc *sc,
ISCSI_SESSION_UNLOCK(is);
#ifdef ICL_KERNEL_PROXY
if (handoff->idh_socket != 0) {
#endif
/*
* Handoff without using ICL proxy.
*/
error = icl_conn_handoff(ic, handoff->idh_socket);
if (error != 0) {
sx_sunlock(&sc->sc_lock);
iscsi_session_terminate(is);
return (error);
}
#ifdef ICL_KERNEL_PROXY
/*
* If we're going through the proxy, the idh_socket will be 0,
* and the ICL module can simply ignore this call. It can also
* use it to determine it's no longer in the Login phase.
*/
error = icl_conn_handoff(ic, handoff->idh_socket);
if (error != 0) {
sx_sunlock(&sc->sc_lock);
iscsi_session_terminate(is);
return (error);
}
#endif
sx_sunlock(&sc->sc_lock);