summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ctld
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2013-09-18 21:15:21 +0000
committertrasz <trasz@FreeBSD.org>2013-09-18 21:15:21 +0000
commit84d8bf623b06793e23ac562d7c7ddd94eb56c6f6 (patch)
tree80b2823e06e6e5379eb2b274b2a1846107b02d4e /usr.sbin/ctld
parent667d7255be08a70cf5f13ef687602bb02959d087 (diff)
downloadFreeBSD-src-84d8bf623b06793e23ac562d7c7ddd94eb56c6f6.zip
FreeBSD-src-84d8bf623b06793e23ac562d7c7ddd94eb56c6f6.tar.gz
Fix several problems in the new iSCSI stack; this includes interoperability
fix for LIO (Linux target), removing possibility for the target to avoid mutual CHAP by choosing to skip authentication altogether, and fixing truncated error messages in iscsictl(8) output. This also fixes several of the problems found with Coverity. Note that this change requires world rebuild. Coverity CID: 1088038, 1087998, 1087990, 1088004, 1088044, 1088041, 1088040 Approved by: re (blanket) Sponsored by: FreeBSD Foundation
Diffstat (limited to 'usr.sbin/ctld')
-rw-r--r--usr.sbin/ctld/ctld.c10
-rw-r--r--usr.sbin/ctld/kernel.c4
2 files changed, 6 insertions, 8 deletions
diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c
index 34fd650..a5472ab 100644
--- a/usr.sbin/ctld/ctld.c
+++ b/usr.sbin/ctld/ctld.c
@@ -348,12 +348,10 @@ portal_group_new(struct conf *conf, const char *name)
{
struct portal_group *pg;
- if (name != NULL) {
- pg = portal_group_find(conf, name);
- if (pg != NULL) {
- log_warnx("duplicated portal-group \"%s\"", name);
- return (NULL);
- }
+ pg = portal_group_find(conf, name);
+ if (pg != NULL) {
+ log_warnx("duplicated portal-group \"%s\"", name);
+ return (NULL);
}
pg = calloc(1, sizeof(*pg));
diff --git a/usr.sbin/ctld/kernel.c b/usr.sbin/ctld/kernel.c
index 869d0a0..0e00204 100644
--- a/usr.sbin/ctld/kernel.c
+++ b/usr.sbin/ctld/kernel.c
@@ -628,7 +628,7 @@ kernel_port_on(void)
struct ctl_port_entry entry;
int error;
- bzero(&entry, sizeof(&entry));
+ bzero(&entry, sizeof(entry));
entry.port_type = CTL_PORT_ISCSI;
entry.targ_port = -1;
@@ -648,7 +648,7 @@ kernel_port_off(void)
struct ctl_port_entry entry;
int error;
- bzero(&entry, sizeof(&entry));
+ bzero(&entry, sizeof(entry));
entry.port_type = CTL_PORT_ISCSI;
entry.targ_port = -1;
OpenPOWER on IntegriCloud