Date: Sun, 20 Jul 2014 07:35:00 +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: r268910 - stable/10/usr.sbin/ctld Message-ID: <201407200735.s6K7Z0qb082892@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Sun Jul 20 07:35:00 2014 New Revision: 268910 URL: http://svnweb.freebsd.org/changeset/base/268910 Log: MFC r268795: Fix ctld crash on startup if target alias is not set. 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 Sun Jul 20 07:31:55 2014 (r268909) +++ stable/10/usr.sbin/ctld/kernel.c Sun Jul 20 07:35:00 2014 (r268910) @@ -851,9 +851,12 @@ kernel_port_add(struct target *targ) req.args[0].value = &port_id; req.args[0].flags = CTL_BEARG_WR; str_arg(&req.args[1], "cfiscsi_target", targ->t_name); - str_arg(&req.args[2], "cfiscsi_target_alias", targ->t_alias); snprintf(tagstr, sizeof(tagstr), "%d", targ->t_portal_group->pg_tag); - str_arg(&req.args[3], "cfiscsi_portal_group_tag", tagstr); + str_arg(&req.args[2], "cfiscsi_portal_group_tag", tagstr); + if (targ->t_alias) + str_arg(&req.args[3], "cfiscsi_target_alias", targ->t_alias); + else + req.num_args--; error = ioctl(ctl_fd, CTL_PORT_REQ, &req); free(req.args);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407200735.s6K7Z0qb082892>