Date: Wed, 11 Mar 2015 09:52:55 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r279880 - stable/10/usr.sbin/ctld Message-ID: <201503110952.t2B9qtVg004768@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Wed Mar 11 09:52:54 2015 New Revision: 279880 URL: https://svnweb.freebsd.org/changeset/base/279880 Log: MFC r279590: If target name starts with "naa.", set it as WWNN for CTL port. Modified: stable/10/usr.sbin/ctld/kernel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Wed Mar 11 09:51:53 2015 (r279879) +++ stable/10/usr.sbin/ctld/kernel.c Wed Mar 11 09:52:54 2015 (r279880) @@ -897,9 +897,21 @@ kernel_port_add(struct port *port) req.status); return (1); } - } else if (port->p_pport) + } else if (port->p_pport) { port->p_ctl_port = port->p_pport->pp_ctl_port; + if (strncmp(targ->t_name, "naa.", 4) == 0 && + strlen(targ->t_name) == 20) { + bzero(&entry, sizeof(entry)); + entry.port_type = CTL_PORT_NONE; + entry.targ_port = port->p_ctl_port; + entry.flags |= CTL_PORT_WWNN_VALID; + entry.wwnn = strtoull(targ->t_name + 4, NULL, 16); + if (ioctl(ctl_fd, CTL_SET_PORT_WWNS, &entry) == -1) + log_warn("CTL_SET_PORT_WWNS ioctl failed"); + } + } + /* Explicitly enable mapping to block any access except allowed. */ lm.port = port->p_ctl_port; lm.plun = UINT32_MAX;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503110952.t2B9qtVg004768>