diff options
author | trasz <trasz@FreeBSD.org> | 2014-05-07 07:56:36 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2014-05-07 07:56:36 +0000 |
commit | c8af11f514a84f09b85327d6ab7085db040d1b7d (patch) | |
tree | 3e78ccecbaef519530a6e9d9880c3edd8843aebf /sys/dev/iscsi | |
parent | 6f6c5103566f1ff9658a15f1c97f0e8e6bb9f6d5 (diff) | |
download | FreeBSD-src-c8af11f514a84f09b85327d6ab7085db040d1b7d.zip FreeBSD-src-c8af11f514a84f09b85327d6ab7085db040d1b7d.tar.gz |
MFC r264549:
Make it possible for the initiator side to operate in both proxy
and normal mode; this makes it possible to compile with the former
by default, but use it only when neccessary. That's especially
important for the userland part.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/dev/iscsi')
-rw-r--r-- | sys/dev/iscsi/iscsi.c | 26 | ||||
-rw-r--r-- | sys/dev/iscsi/iscsi_ioctl.h | 10 |
2 files changed, 24 insertions, 12 deletions
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index fc90a93..8723237 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -1303,12 +1303,19 @@ iscsi_ioctl_daemon_handoff(struct iscsi_softc *sc, ISCSI_SESSION_UNLOCK(is); -#ifndef ICL_KERNEL_PROXY - error = icl_conn_handoff(is->is_conn, handoff->idh_socket); - if (error != 0) { - sx_sunlock(&sc->sc_lock); - iscsi_session_terminate(is); - return (error); +#ifdef ICL_KERNEL_PROXY + if (handoff->idh_socket != 0) { +#endif + /* + * Handoff without using ICL proxy. + */ + error = icl_conn_handoff(is->is_conn, handoff->idh_socket); + if (error != 0) { + sx_sunlock(&sc->sc_lock); + iscsi_session_terminate(is); + return (error); + } +#ifdef ICL_KERNEL_PROXY } #endif @@ -1419,13 +1426,18 @@ iscsi_ioctl_daemon_connect(struct iscsi_softc *sc, if (idc->idc_from_addrlen > 0) { error = getsockaddr(&from_sa, (void *)idc->idc_from_addr, idc->idc_from_addrlen); - if (error != 0) + if (error != 0) { + ISCSI_SESSION_WARN(is, + "getsockaddr failed with error %d", error); return (error); + } } else { from_sa = NULL; } error = getsockaddr(&to_sa, (void *)idc->idc_to_addr, idc->idc_to_addrlen); if (error != 0) { + ISCSI_SESSION_WARN(is, "getsockaddr failed with error %d", + error); free(from_sa, M_SONAME); return (error); } diff --git a/sys/dev/iscsi/iscsi_ioctl.h b/sys/dev/iscsi/iscsi_ioctl.h index ae848af..ace1ebd 100644 --- a/sys/dev/iscsi/iscsi_ioctl.h +++ b/sys/dev/iscsi/iscsi_ioctl.h @@ -129,9 +129,9 @@ struct iscsi_daemon_fail { /* * When ICL_KERNEL_PROXY is not defined, the iscsid(8) is responsible - * for creating the socket, connecting, performing Login Phase using - * socked in the usual userspace way, and then passing the socket file - * descriptor to the kernel part using ISCSIDHANDOFF. + * for creating the socket, connecting, and performing Login Phase using + * the socket in the usual userspace way, and then passing the socket + * file descriptor to the kernel part using ISCSIDHANDOFF. * * When ICL_KERNEL_PROXY is defined, the iscsid(8) creates the session * using ISCSICONNECT, performs Login Phase using ISCSISEND/ISCSIRECEIVE @@ -162,7 +162,7 @@ struct iscsi_daemon_send { void *ids_spare2; size_t ids_data_segment_len; void *ids_data_segment; - int ids_spare[4]; + int ids_spare3[4]; }; struct iscsi_daemon_receive { @@ -172,7 +172,7 @@ struct iscsi_daemon_receive { void *idr_spare2; size_t idr_data_segment_len; void *idr_data_segment; - int idr_spare[4]; + int idr_spare3[4]; }; #define ISCSIDCONNECT _IOWR('I', 0x04, struct iscsi_daemon_connect) |