summaryrefslogtreecommitdiffstats
path: root/sys/dev/iscsi/iscsi.c
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2014-05-07 07:56:36 +0000
committertrasz <trasz@FreeBSD.org>2014-05-07 07:56:36 +0000
commitc8af11f514a84f09b85327d6ab7085db040d1b7d (patch)
tree3e78ccecbaef519530a6e9d9880c3edd8843aebf /sys/dev/iscsi/iscsi.c
parent6f6c5103566f1ff9658a15f1c97f0e8e6bb9f6d5 (diff)
downloadFreeBSD-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/iscsi.c')
-rw-r--r--sys/dev/iscsi/iscsi.c26
1 files changed, 19 insertions, 7 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);
}
OpenPOWER on IntegriCloud