aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ctld/kernel.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2015-03-04 14:12:38 +0000
committerAlexander Motin <mav@FreeBSD.org>2015-03-04 14:12:38 +0000
commitaadf439b221255863edb9a047a6d8f03201a5677 (patch)
tree5376bc69a3b4320a877e9060ad81190c73865485 /usr.sbin/ctld/kernel.c
parente9b7390bb227841fb7fc66cbd24fe4ebfcddfea0 (diff)
downloadsrc-aadf439b221255863edb9a047a6d8f03201a5677.tar.gz
src-aadf439b221255863edb9a047a6d8f03201a5677.zip
Notes
Diffstat (limited to 'usr.sbin/ctld/kernel.c')
-rw-r--r--usr.sbin/ctld/kernel.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/ctld/kernel.c b/usr.sbin/ctld/kernel.c
index c9e44688f7fb..95bc89ceb99a 100644
--- a/usr.sbin/ctld/kernel.c
+++ b/usr.sbin/ctld/kernel.c
@@ -935,9 +935,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;