diff options
Diffstat (limited to 'usr.sbin/ctld/kernel.c')
-rw-r--r-- | usr.sbin/ctld/kernel.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.sbin/ctld/kernel.c b/usr.sbin/ctld/kernel.c index 0b55449..af8c5c5 100644 --- a/usr.sbin/ctld/kernel.c +++ b/usr.sbin/ctld/kernel.c @@ -120,6 +120,7 @@ struct cctl_lun { struct cctl_port { uint32_t port_id; + int cfiscsi_status; char *cfiscsi_target; uint16_t cfiscsi_portal_group_tag; STAILQ_HEAD(,cctl_lun_nv) attr_list; @@ -332,6 +333,8 @@ cctl_end_pelement(void *user_data, const char *name) if (strcmp(name, "cfiscsi_target") == 0) { cur_port->cfiscsi_target = str; str = NULL; + } else if (strcmp(name, "cfiscsi_status") == 0) { + cur_port->cfiscsi_status = strtoul(str, NULL, 0); } else if (strcmp(name, "cfiscsi_portal_group_tag") == 0) { cur_port->cfiscsi_portal_group_tag = strtoul(str, NULL, 0); } else if (strcmp(name, "targ_port") == 0) { @@ -494,6 +497,11 @@ retry_port: "ignoring", (uintmax_t)port->port_id); continue; } + if (port->cfiscsi_status != 1) { + log_debugx("CTL port %ju is not active (%d); ignoring", + (uintmax_t)port->port_id, port->cfiscsi_status); + continue; + } targ = target_find(conf, port->cfiscsi_target); if (targ == NULL) { |