diff options
author | trasz <trasz@FreeBSD.org> | 2014-05-07 07:29:39 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2014-05-07 07:29:39 +0000 |
commit | 690b7a7a127bf05683bcac2f8623f493fa28647f (patch) | |
tree | 45ec51b4a29a711d6386f8830a84b1a439c93a3f /usr.sbin/ctld/kernel.c | |
parent | 7420d3ad268a728f49008826fe586a7d613617bf (diff) | |
download | FreeBSD-src-690b7a7a127bf05683bcac2f8623f493fa28647f.zip FreeBSD-src-690b7a7a127bf05683bcac2f8623f493fa28647f.tar.gz |
MFC r264524:
Make it possible for the iSCSI target side to operate in both normal
and ICL_KERNEL_PROXY mode, and fix some bit rot so the latter actually
works again.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.sbin/ctld/kernel.c')
-rw-r--r-- | usr.sbin/ctld/kernel.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/ctld/kernel.c b/usr.sbin/ctld/kernel.c index 4796a68..a0e68ba 100644 --- a/usr.sbin/ctld/kernel.c +++ b/usr.sbin/ctld/kernel.c @@ -65,11 +65,13 @@ #include <cam/ctl/ctl_util.h> #include <cam/ctl/ctl_scsi_all.h> +#include "ctld.h" + #ifdef ICL_KERNEL_PROXY #include <netdb.h> #endif -#include "ctld.h" +extern bool proxy_mode; static int ctl_fd = 0; @@ -599,7 +601,14 @@ kernel_handoff(struct connection *conn) } strlcpy(req.data.handoff.target_name, conn->conn_target->t_name, sizeof(req.data.handoff.target_name)); +#ifdef ICL_KERNEL_PROXY + if (proxy_mode) + req.data.handoff.connection_id = conn->conn_socket; + else + req.data.handoff.socket = conn->conn_socket; +#else req.data.handoff.socket = conn->conn_socket; +#endif req.data.handoff.portal_group_tag = conn->conn_portal->p_portal_group->pg_tag; if (conn->conn_header_digest == CONN_DIGEST_CRC32C) |