CVS commit: src/external/bsd/iscsi/dist/src/lib

2021-01-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jan 17 00:13:49 UTC 2021

Modified Files:
src/external/bsd/iscsi/dist/src/lib: initiator.c

Log Message:
remove unset (and always printed as "(null)") gfilename variable.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/iscsi/dist/src/lib/initiator.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/initiator.c
diff -u src/external/bsd/iscsi/dist/src/lib/initiator.c:1.11 src/external/bsd/iscsi/dist/src/lib/initiator.c:1.12
--- src/external/bsd/iscsi/dist/src/lib/initiator.c:1.11	Sun Sep  6 17:06:20 2020
+++ src/external/bsd/iscsi/dist/src/lib/initiator.c	Sun Jan 17 00:13:49 2021
@@ -92,7 +92,6 @@ static iscsi_worker_t g_enqueue_worker;
 static iscsi_queue_t g_enqueue_q;
 static iscsi_queue_t g_session_q;
 static int  g_initiator_state;
-static char   *gfilename;
 
 /* Testing of initiator_abort */
 
@@ -905,9 +904,6 @@ iscsi_initiator_start(iscsi_initiator_t 
 		set_debug(dbg);
 	}
 	iscsi_trace(TRACE_ISCSI_DEBUG, "initializing initiator\n");
-	iscsi_trace(TRACE_ISCSI_DEBUG,
-		"target config filename to read from: %s\n", gfilename
-		? gfilename : "(null)");
 	port = atoi(iscsi_initiator_getvar(ini, "target port"));
 	if (get_target_config(iscsi_initiator_getvar(ini,
 "target hostname"), port) != 0) {
@@ -3715,9 +3711,6 @@ ii_initiator_init(const char *hostname, 
 
 	USE_ARG(address_family);
 	iscsi_trace(TRACE_ISCSI_DEBUG, "initializing initiator\n");
-	iscsi_trace(TRACE_ISCSI_DEBUG,
-	"target config filename to read from: %s\n", gfilename ?
-	gfilename : "(null)");
 	if (get_target_config(hostname, port) != 0) {
 		iscsi_err(__FILE__, __LINE__, "Error getting target configuration from config file\n");
 		return -1;



CVS commit: src/external/bsd/iscsi/dist/src/lib

2020-09-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep  6 17:06:20 UTC 2020

Modified Files:
src/external/bsd/iscsi/dist/src/lib: initiator.c

Log Message:
fix null argument


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/iscsi/dist/src/lib/initiator.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/initiator.c
diff -u src/external/bsd/iscsi/dist/src/lib/initiator.c:1.10 src/external/bsd/iscsi/dist/src/lib/initiator.c:1.11
--- src/external/bsd/iscsi/dist/src/lib/initiator.c:1.10	Mon Mar 16 20:57:54 2020
+++ src/external/bsd/iscsi/dist/src/lib/initiator.c	Sun Sep  6 13:06:20 2020
@@ -906,7 +906,8 @@ iscsi_initiator_start(iscsi_initiator_t 
 	}
 	iscsi_trace(TRACE_ISCSI_DEBUG, "initializing initiator\n");
 	iscsi_trace(TRACE_ISCSI_DEBUG,
-		"target config filename to read from:%s\n", gfilename);
+		"target config filename to read from: %s\n", gfilename
+		? gfilename : "(null)");
 	port = atoi(iscsi_initiator_getvar(ini, "target port"));
 	if (get_target_config(iscsi_initiator_getvar(ini,
 "target hostname"), port) != 0) {
@@ -3714,7 +3715,9 @@ ii_initiator_init(const char *hostname, 
 
 	USE_ARG(address_family);
 	iscsi_trace(TRACE_ISCSI_DEBUG, "initializing initiator\n");
-	iscsi_trace(TRACE_ISCSI_DEBUG, "target config filename to read from:%s\n", gfilename);
+	iscsi_trace(TRACE_ISCSI_DEBUG,
+	"target config filename to read from: %s\n", gfilename ?
+	gfilename : "(null)");
 	if (get_target_config(hostname, port) != 0) {
 		iscsi_err(__FILE__, __LINE__, "Error getting target configuration from config file\n");
 		return -1;



CVS commit: src/external/bsd/iscsi/dist/src/lib

2020-03-16 Thread Santhosh Raju
Module Name:src
Committed By:   fox
Date:   Tue Mar 17 00:57:55 UTC 2020

Modified Files:
src/external/bsd/iscsi/dist/src/lib: initiator.c

Log Message:
external/bsd/iscsi: Fix -Werror=maybe-uninitialized error in initiator.c.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Submitted by: mlelstv@
Reviewed by: kamil@


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/iscsi/dist/src/lib/initiator.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/initiator.c
diff -u src/external/bsd/iscsi/dist/src/lib/initiator.c:1.9 src/external/bsd/iscsi/dist/src/lib/initiator.c:1.10
--- src/external/bsd/iscsi/dist/src/lib/initiator.c:1.9	Fri Nov  1 07:53:34 2013
+++ src/external/bsd/iscsi/dist/src/lib/initiator.c	Tue Mar 17 00:57:54 2020
@@ -794,6 +794,7 @@ discovery_phase(int target, strv_t *svp)
 		}
 	} else {
 		/* the user has asked for a specific target - find it */
+		ptr = NULL;
 		for (i = 0 ; i < svp->c ; i += 2) {
 			if (strcmp(g_target[target].iqnwanted,
 	svp->v[i]) == 0) {
@@ -803,7 +804,7 @@ discovery_phase(int target, strv_t *svp)
 break;
 			}
 		}
-		if (i >= svp->c) {
+		if (ptr == NULL) {
 			iscsi_err(__FILE__, __LINE__,
 "SendTargets failed - target `%s' not found\n",
 g_target[target].iqnwanted);



CVS commit: src/external/bsd/iscsi/dist/src/lib

2014-11-14 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Nov 15 01:15:45 UTC 2014

Modified Files:
src/external/bsd/iscsi/dist/src/lib: parameters.c target.c

Log Message:
Drop pointer checks that are always true.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/iscsi/dist/src/lib/parameters.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/iscsi/dist/src/lib/target.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/parameters.c
diff -u src/external/bsd/iscsi/dist/src/lib/parameters.c:1.3 src/external/bsd/iscsi/dist/src/lib/parameters.c:1.4
--- src/external/bsd/iscsi/dist/src/lib/parameters.c:1.3	Thu Mar 15 04:06:54 2012
+++ src/external/bsd/iscsi/dist/src/lib/parameters.c	Sat Nov 15 01:15:45 2014
@@ -919,12 +919,7 @@ answer:
 		if (strcmp(value, ?) == 0) {
 			iscsi_trace(TRACE_ISCSI_PARAM, got inquiry for param \%s\\n, param-key);
 			if (param-value_l) {
-if (param-value_l-value) {
-	(void) strlcpy(param-answer_tx, param-value_l-value, sizeof(param-answer_tx));
-} else {
-	iscsi_err(__FILE__, __LINE__, param \%s\ has NULL value_l-value\n, param-key);
-	param-answer_tx[0] = 0x0;
-}
+(void) strlcpy(param-answer_tx, param-value_l-value, sizeof(param-answer_tx));
 			} else {
 iscsi_err(__FILE__, __LINE__, param \%s\ has NULL value_l\n, param-key);
 param-answer_tx[0] = 0x0;

Index: src/external/bsd/iscsi/dist/src/lib/target.c
diff -u src/external/bsd/iscsi/dist/src/lib/target.c:1.8 src/external/bsd/iscsi/dist/src/lib/target.c:1.9
--- src/external/bsd/iscsi/dist/src/lib/target.c:1.8	Tue Sep 30 15:24:15 2014
+++ src/external/bsd/iscsi/dist/src/lib/target.c	Sat Nov 15 01:15:45 2014
@@ -762,8 +762,7 @@ text_command_t(target_session_t * sess, 
 			return -1;
 		}
 		if (ptr-rx_offer) {
-			if (ptr-offer_rx 
-			strcmp(ptr-offer_rx, All) == 0 
+			if (strcmp(ptr-offer_rx, All) == 0 
 			!param_equiv(sess-params, SessionType,
 				Discovery)) {
 iscsi_trace(TRACE_ISCSI_DEBUG,



CVS commit: src/external/bsd/iscsi/dist/src/lib

2014-09-30 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Sep 30 15:24:15 UTC 2014

Modified Files:
src/external/bsd/iscsi/dist/src/lib: target.c

Log Message:
the buffer is also used when there is no input


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/iscsi/dist/src/lib/target.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/target.c
diff -u src/external/bsd/iscsi/dist/src/lib/target.c:1.7 src/external/bsd/iscsi/dist/src/lib/target.c:1.8
--- src/external/bsd/iscsi/dist/src/lib/target.c:1.7	Wed Mar  3 00:44:51 2010
+++ src/external/bsd/iscsi/dist/src/lib/target.c	Tue Sep 30 15:24:15 2014
@@ -321,9 +321,7 @@ scsi_command_t(target_session_t *sess, u
 	* there is input data and set the length of the input to
 	* either scsi_cmd.trans_len or scsi_cmd.bidi_trans_len,
 	* depending on whether scsi_cmd.output was set.  */
-	if (scsi_cmd.input) {
-		scsi_cmd.send_data = sess-buff;
-	}
+	scsi_cmd.send_data = sess-buff;
 	scsi_cmd.input = 0;
 	cmd.scsi_cmd = scsi_cmd;
 	cmd.callback = NULL;



CVS commit: src/external/bsd/iscsi/dist/src/lib

2014-09-30 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Sep 30 15:25:18 UTC 2014

Modified Files:
src/external/bsd/iscsi/dist/src/lib: disk.c

Log Message:
make seek test routine work with the configured block size.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/iscsi/dist/src/lib/disk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/disk.c
diff -u src/external/bsd/iscsi/dist/src/lib/disk.c:1.8 src/external/bsd/iscsi/dist/src/lib/disk.c:1.9
--- src/external/bsd/iscsi/dist/src/lib/disk.c:1.8	Sat Sep 29 07:18:21 2012
+++ src/external/bsd/iscsi/dist/src/lib/disk.c	Tue Sep 30 15:25:18 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: disk.c,v 1.8 2012/09/29 07:18:21 mlelstv Exp $ */
+/* $NetBSD: disk.c,v 1.9 2014/09/30 15:25:18 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -703,33 +703,38 @@ device_set_var(const char *var, const ch
 /* allocate some space for a disk/extent, using an lseek, read and
 * write combination */
 static int
-de_allocate(disc_de_t *de, char *filename)
+de_allocate(disc_de_t *de, char *filename, uint64_t blocklen)
 {
 	off_t	size;
-	char	block[DEFAULT_TARGET_BLOCK_LEN];
+	char	 *block;
 
+	block = malloc(blocklen);
 	size = de_getsize(de);
-	if (de_lseek(de, size - sizeof(block), SEEK_SET) == -1) {
+	if (de_lseek(de, size - blocklen, SEEK_SET) == -1) {
 		iscsi_err(__FILE__, __LINE__,
 error seeking \%s\\n, filename);
+		free(block);
 		return 0;
 	}
-	if (de_read(de, block, sizeof(block)) == -1) {
+	if (de_read(de, block, blocklen) == -1) {
 		iscsi_err(__FILE__, __LINE__,
 error reading \%s\\n, filename);
+		free(block);
 		return 0;
 	}
-	if (de_write(de, block, sizeof(block)) == -1) {
+	if (de_write(de, block, blocklen) == -1) {
 		iscsi_err(__FILE__, __LINE__,
 error writing \%s\\n, filename);
+		free(block);
 		return 0;
 	}
+	free(block);
 	return 1;
 }
 
 /* allocate space as desired */
 static int
-allocate_space(disc_target_t *tp)
+allocate_space(disc_target_t *tp, uint64_t blocklen)
 {
 	uint32_t	i;
 
@@ -737,10 +742,10 @@ allocate_space(disc_target_t *tp)
 	following write() in de_allocate is non-destructive */
 	switch(tp-de.type) {
 	case DE_EXTENT:
-		return de_allocate(tp-de, tp-target);
+		return de_allocate(tp-de, tp-target, blocklen);
 	case DE_DEVICE:
 		for (i = 0 ; i  tp-de.u.dp-c ; i++) {
-			if (!de_allocate(tp-de.u.dp-xv[i], tp-target)) {
+			if (!de_allocate(tp-de.u.dp-xv[i], tp-target, blocklen)) {
 return 0;
 			}
 		}
@@ -877,7 +882,7 @@ device_init(iscsi_target_t *tgt, targv_t
 			error opening \%s\\n, idisk-filename);
 		return -1;
 	}
-	if (!(tp-flags  TARGET_READONLY)  !allocate_space(tp)) {
+	if (!(tp-flags  TARGET_READONLY)  !allocate_space(tp, idisk-blocklen)) {
 		iscsi_err(__FILE__, __LINE__,
 			error allocating space for \%s\\n, tp-target);
 		return -1;
@@ -1514,7 +1519,7 @@ disk_read(target_session_t *sess, iscsi_
 			(unsigned) bytec;
 	args-length = (unsigned) bytec;
 	args-send_sg_len = 1;
-	args-status = 0;
+	args-status = SCSI_SUCCESS;
 	args-send_buffer = ptr;
 	return 0;
 out:



CVS commit: src/external/bsd/iscsi/dist/src/lib

2013-11-01 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Nov  1 07:53:34 UTC 2013

Modified Files:
src/external/bsd/iscsi/dist/src/lib: initiator.c

Log Message:
rfc3720 Appendix D. SendTargets Operation requires that requesting
information for all relevant targets is done with the value 'All'
(upper case A) and some implementations require it.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/iscsi/dist/src/lib/initiator.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/initiator.c
diff -u src/external/bsd/iscsi/dist/src/lib/initiator.c:1.8 src/external/bsd/iscsi/dist/src/lib/initiator.c:1.9
--- src/external/bsd/iscsi/dist/src/lib/initiator.c:1.8	Thu Mar 15 04:06:54 2012
+++ src/external/bsd/iscsi/dist/src/lib/initiator.c	Fri Nov  1 07:53:34 2013
@@ -646,7 +646,7 @@ iscsi_initiator_get_targets(int target, 
 text_len = 0;
 text[0] = 0x0;
 
-PARAM_TEXT_ADD(sess-params, SendTargets, all, text, text_len,
+PARAM_TEXT_ADD(sess-params, SendTargets, All, text, text_len,
 			DISCOVERY_PHASE_TEXT_LEN, 1, DP_ERROR);
 PARAM_TEXT_PARSE(sess-params, sess-sess_params.cred, text,
 			text_len, NULL, NULL, DISCOVERY_PHASE_TEXT_LEN, 1,
@@ -749,7 +749,7 @@ discovery_phase(int target, strv_t *svp)
 	/* Full Feature Phase Negotiation (for SendTargets) */
 	text_len = 0;
 	text[0] = 0x0;
-	PARAM_TEXT_ADD(sess-params, SendTargets, all, text, text_len,
+	PARAM_TEXT_ADD(sess-params, SendTargets, All, text, text_len,
 		DISCOVERY_PHASE_TEXT_LEN, 1, DP_ERROR);
 	PARAM_TEXT_PARSE(sess-params, sess-sess_params.cred, text,
 		text_len, NULL, NULL, DISCOVERY_PHASE_TEXT_LEN, 1, DP_ERROR);



CVS commit: src/external/bsd/iscsi/dist/src/lib

2013-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 19:13:26 UTC 2013

Modified Files:
src/external/bsd/iscsi/dist/src/lib: util.c

Log Message:
PR 48338: fix typo making a boolean expression always true


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/iscsi/dist/src/lib/util.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/util.c
diff -u src/external/bsd/iscsi/dist/src/lib/util.c:1.3 src/external/bsd/iscsi/dist/src/lib/util.c:1.4
--- src/external/bsd/iscsi/dist/src/lib/util.c:1.3	Thu Mar 15 04:06:55 2012
+++ src/external/bsd/iscsi/dist/src/lib/util.c	Thu Oct 24 19:13:25 2013
@@ -1273,7 +1273,7 @@ HexTextToData(const char *text, uint32_t
 	uint32_tn2;
 	uint32_tlen = 0;
 
-	if ((text[0] == '0')  (text[1] != 'x' || text[1] != 'X')) {
+	if ((text[0] == '0')  (text[1] == 'x' || text[1] == 'X')) {
 		/* skip prefix */
 		text += 2;
 		textLength -= 2;



CVS commit: src/external/bsd/iscsi/dist/src/lib

2011-11-04 Thread Aleksey Cheusov
Module Name:src
Committed By:   cheusov
Date:   Sat Nov  5 00:17:19 UTC 2011

Modified Files:
src/external/bsd/iscsi/dist/src/lib: md5hl.c

Log Message:
Fix segfault when read(2) returns -1


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/iscsi/dist/src/lib/md5hl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/md5hl.c
diff -u src/external/bsd/iscsi/dist/src/lib/md5hl.c:1.2 src/external/bsd/iscsi/dist/src/lib/md5hl.c:1.3
--- src/external/bsd/iscsi/dist/src/lib/md5hl.c:1.2	Tue Jun 30 02:44:52 2009
+++ src/external/bsd/iscsi/dist/src/lib/md5hl.c	Sat Nov  5 00:17:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: md5hl.c,v 1.2 2009/06/30 02:44:52 agc Exp $	*/
+/*	$NetBSD: md5hl.c,v 1.3 2011/11/05 00:17:19 cheusov Exp $	*/
 
 /*
  * Written by Jason R. Thorpe thor...@netbsd.org, April 29, 1997.
@@ -18,7 +18,7 @@
 #define _DIAGASSERT(cond)	assert(cond)
 #endif
 
-/*	$NetBSD: md5hl.c,v 1.2 2009/06/30 02:44:52 agc Exp $	*/
+/*	$NetBSD: md5hl.c,v 1.3 2011/11/05 00:17:19 cheusov Exp $	*/
 
 /*
  * 
@@ -84,7 +84,7 @@ MDNAME(File)(filename, buf)
 	unsigned char buffer[BUFSIZ];
 	MDNAME(_CTX) ctx;
 	int f, j;
-	size_t i;
+	ssize_t i;
 
 	_DIAGASSERT(filename != 0);
 	/* buf may be NULL */



CVS commit: src/external/bsd/iscsi/dist/src/lib

2011-11-02 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Nov  2 16:45:00 UTC 2011

Modified Files:
src/external/bsd/iscsi/dist/src/lib: libiscsi.3

Log Message:
fix a function prototype


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/iscsi/dist/src/lib/libiscsi.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/libiscsi.3
diff -u src/external/bsd/iscsi/dist/src/lib/libiscsi.3:1.4 src/external/bsd/iscsi/dist/src/lib/libiscsi.3:1.5
--- src/external/bsd/iscsi/dist/src/lib/libiscsi.3:1.4	Sun Feb 20 03:56:36 2011
+++ src/external/bsd/iscsi/dist/src/lib/libiscsi.3	Wed Nov  2 16:45:00 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: libiscsi.3,v 1.4 2011/02/20 03:56:36 agc Exp $
+.\ $NetBSD: libiscsi.3,v 1.5 2011/11/02 16:45:00 yamt Exp $
 .\
 .\ Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -64,7 +64,6 @@
 .Ft char *
 .Fo iscsi_target_getvar
 .Fa iscsi_target_t *target const char *name
-.Fa iscsi_target_t *target
 .Fc
 .Ft int
 .Fo iscsi_initiator_set_defaults



CVS commit: src/external/bsd/iscsi/dist/src/lib

2011-11-02 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Nov  2 20:26:03 UTC 2011

Modified Files:
src/external/bsd/iscsi/dist/src/lib: libiscsi.3

Log Message:
Use standard section names.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/iscsi/dist/src/lib/libiscsi.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/libiscsi.3
diff -u src/external/bsd/iscsi/dist/src/lib/libiscsi.3:1.5 src/external/bsd/iscsi/dist/src/lib/libiscsi.3:1.6
--- src/external/bsd/iscsi/dist/src/lib/libiscsi.3:1.5	Wed Nov  2 16:45:00 2011
+++ src/external/bsd/iscsi/dist/src/lib/libiscsi.3	Wed Nov  2 20:26:03 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: libiscsi.3,v 1.5 2011/11/02 16:45:00 yamt Exp $
+.\ $NetBSD: libiscsi.3,v 1.6 2011/11/02 20:26:03 wiz Exp $
 .\
 .\ Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -158,5 +158,5 @@ This programmatic interface to the
 iSCSI subsystem
 first appeared in
 .Nx 6.0 .
-.Sh AUTHOR
+.Sh AUTHORS
 .An Alistair Crooks Aq a...@netbsd.org .



CVS commit: src/external/bsd/iscsi/dist/src/lib

2011-02-22 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Tue Feb 22 13:10:55 UTC 2011

Modified Files:
src/external/bsd/iscsi/dist/src/lib: initiator.c protocol.c

Log Message:
Skip target if TargetName is empty.
Use relevant TargetAddress, not just first one we happen to find.

Following improvement based on feedback from Daisuke Aoyama (author of istgt):
Handle NOP-OUT CmdSN and immediate bit.
Handle NOP-IN TransferTag=0x.
Interim solution for dealing with Underflow bit in iSCSI response.

iscsi-initiator now talks to istgt and other targets.

Remaining issues:
CHAP support will not work with most targets (maximum 16 octet challenge is
used, but other initiators use up to 1024). However, CHAP can now be
bypassed by not specifying a username.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/iscsi/dist/src/lib/initiator.c
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/iscsi/dist/src/lib/protocol.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/initiator.c
diff -u src/external/bsd/iscsi/dist/src/lib/initiator.c:1.4 src/external/bsd/iscsi/dist/src/lib/initiator.c:1.5
--- src/external/bsd/iscsi/dist/src/lib/initiator.c:1.4	Mon Feb 21 17:48:43 2011
+++ src/external/bsd/iscsi/dist/src/lib/initiator.c	Tue Feb 22 13:10:55 2011
@@ -630,6 +630,7 @@
 iscsi_parameter_t	*ip;
 char			*text = NULL;
 int			 text_len = 0;
+int			 pos = 0;
 
 if ((text = iscsi_malloc_atomic(DISCOVERY_PHASE_TEXT_LEN)) == NULL) {
 iscsi_err(__FILE__, __LINE__, iscsi_malloc_atomic() failed\n);
@@ -651,13 +652,23 @@
 }   
 for (ip = sess-params ; ip ; ip = ip-next) {
 if (strcmp(ip-key, TargetName) == 0) {
-for (vp = ip-value_l ; vp ; vp = vp-next) {
+	pos = 0;
+for (vp = ip-value_l ; vp ; vp = vp-next, pos++) {
+	/*
+	 * Skip items which have no name,
+	 * these have been blocked by the target
+	 */
+	if (!strlen(vp-value))
+		continue;
+
 ALLOC(char *, svp-v, svp-size, svp-c, 10,
 		10, igt, return -1);
 svp-v[svp-c++] = strdup(vp-value);
 ALLOC(char *, svp-v, svp-size, svp-c, 10,
 		10, igt2, return -1);
-svp-v[svp-c++] = strdup(param_val(sess-params, TargetAddress));
+svp-v[svp-c++] =
+ strdup(param_val_which(sess-params,
+ TargetAddress, pos));
 }
 }
 }
@@ -2466,7 +2477,8 @@
 	/* Encapsulate and send NOP */
 
 	nop_out-ExpStatSN = sess-ExpStatSN;
-	/* nop_out-CmdSN = sess-CmdSN++; */
+	nop_out-immediate = 1;
+	nop_out-CmdSN = sess-CmdSN;
 	nop_out-transfer_tag = 0x;
 	if (iscsi_nop_out_encap(header, nop_out) != 0) {
 		iscsi_err(__FILE__, __LINE__, iscsi_nop_out_encap() failed\n);
@@ -2901,6 +2913,16 @@
 		iscsi_err(__FILE__, __LINE__, iscsi_nop_in() failed\n);
 		return -1;
 	}
+	if (nop_in.transfer_tag == 0x) {
+		if (nop_in.length != 0) {
+			iscsi_err(__FILE__, __LINE__,
+nop_in.length %u not 0\n,
+nop_in.length);
+			NO_CLEANUP;
+			return -1;
+		}
+		return 0;
+	}
 	if (cmd) {
 #if 0
 		RETURN_NOT_EQUAL(nop_in.length, nop_in.length, nop_out-length, NO_CLEANUP, -1);
@@ -3400,12 +3422,14 @@
 	errmsg = NULL;
 	if (data.overflow != 0) {
 		errmsg = Overflow bit;
-	} else if (data.underflow != 0) {
-		errmsg = Underflow bit;
 	} else if (data.task_tag != scsi_cmd-tag) {
 		errmsg = Tag;
-	} else if (data.task_tag != scsi_cmd-tag) {
-		errmsg = Residual Count;
+	} else if (!data.underflow) {
+		if (data.res_count != 0) {
+			errmsg = Residual Count;
+		}
+	} else {
+		iscsi_warn(__FILE__, __LINE__, Underflow %s\n, data.res_count);
 	}
 	if (errmsg) {
 		iscsi_err(__FILE__, __LINE__, errmsg);

Index: src/external/bsd/iscsi/dist/src/lib/protocol.c
diff -u src/external/bsd/iscsi/dist/src/lib/protocol.c:1.1 src/external/bsd/iscsi/dist/src/lib/protocol.c:1.2
--- src/external/bsd/iscsi/dist/src/lib/protocol.c:1.1	Tue Jun 30 02:44:52 2009
+++ src/external/bsd/iscsi/dist/src/lib/protocol.c	Tue Feb 22 13:10:55 2011
@@ -1457,7 +1457,7 @@
 		errmsg = Byte 4;
 	} else if (memcmp(header + 8, zeros, 8) != 0) {
 		errmsg = Bytes 8-15;
-	} else if (memcmp(header + 44, zeros, 4) != 0) {
+	} else if (!cmd-underflow  memcmp(header + 44, zeros, 4) != 0) {
 		errmsg = Bytes 44-47;
 	}
 	if (errmsg) {



CVS commit: src/external/bsd/iscsi/dist/src/lib

2011-02-19 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Sun Feb 20 03:56:36 UTC 2011

Modified Files:
src/external/bsd/iscsi/dist/src/lib: libiscsi.3

Log Message:
manual page improvements, from enami tsugutomo, with thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/iscsi/dist/src/lib/libiscsi.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/libiscsi.3
diff -u src/external/bsd/iscsi/dist/src/lib/libiscsi.3:1.3 src/external/bsd/iscsi/dist/src/lib/libiscsi.3:1.4
--- src/external/bsd/iscsi/dist/src/lib/libiscsi.3:1.3	Wed Jul 15 09:50:08 2009
+++ src/external/bsd/iscsi/dist/src/lib/libiscsi.3	Sun Feb 20 03:56:36 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: libiscsi.3,v 1.3 2009/07/15 09:50:08 joerg Exp $
+.\ $NetBSD: libiscsi.3,v 1.4 2011/02/20 03:56:36 agc Exp $
 .\
 .\ Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd June 24, 2009
+.Dd February 19, 2011
 .Dt LIBISCSI 3
 .Os
 .Sh NAME
@@ -148,7 +148,7 @@
 are serving up block storage according to the variables
 which have already been set.
 .Sh SEE ALSO
-.Xr iscsi-initiator 8
+.Xr iscsi-initiator 8 ,
 .Xr iscsi-target 8
 .Sh HISTORY
 The
@@ -156,7 +156,8 @@
 library first appeared in
 .Nx 4.0 .
 This programmatic interface to the
-.Nm library first appeared in
+iSCSI subsystem
+first appeared in
 .Nx 6.0 .
 .Sh AUTHOR
 .An Alistair Crooks Aq a...@netbsd.org .



CVS commit: src/external/bsd/iscsi/dist/src/lib

2011-02-08 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Wed Feb  9 00:59:24 UTC 2011

Modified Files:
src/external/bsd/iscsi/dist/src/lib: initiator.c

Log Message:
Make sure we include inttypes.h if we have it.  From Rumko.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/iscsi/dist/src/lib/initiator.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/initiator.c
diff -u src/external/bsd/iscsi/dist/src/lib/initiator.c:1.2 src/external/bsd/iscsi/dist/src/lib/initiator.c:1.3
--- src/external/bsd/iscsi/dist/src/lib/initiator.c:1.2	Tue Jun 30 02:44:52 2009
+++ src/external/bsd/iscsi/dist/src/lib/initiator.c	Wed Feb  9 00:59:23 2011
@@ -58,6 +58,10 @@
 #include netinet/tcp.h
 #endif
   
+#ifdef HAVE_INTTYPES_H
+#include inttypes.h
+#endif
+  
 #ifdef HAVE_SIGNAL_H
 #include signal.h
 #endif



CVS commit: src/external/bsd/iscsi/dist/src/lib

2010-01-25 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Mon Jan 25 13:45:16 UTC 2010

Modified Files:
src/external/bsd/iscsi/dist/src/lib: target.c

Log Message:
scsi_command_t: rather than putting cleanup code before every
return statememts, use goto to a single copy of the cleanup code.
no functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/iscsi/dist/src/lib/target.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/target.c
diff -u src/external/bsd/iscsi/dist/src/lib/target.c:1.5 src/external/bsd/iscsi/dist/src/lib/target.c:1.6
--- src/external/bsd/iscsi/dist/src/lib/target.c:1.5	Wed Jan 20 11:50:28 2010
+++ src/external/bsd/iscsi/dist/src/lib/target.c	Mon Jan 25 13:45:16 2010
@@ -173,12 +173,16 @@
 	target_cmd_t		cmd;
 	uint32_t		DataSN = 0;
 	uint8_t			rsp_header[ISCSI_HEADER_LEN];
+	struct iovec		*sg_new = NULL;
+	int			result;
 
 	(void) memset(scsi_cmd, 0x0, sizeof(scsi_cmd));
+	scsi_cmd.ahs = NULL;
 	if (iscsi_scsi_cmd_decap(header, scsi_cmd) != 0) {
 		iscsi_err(__FILE__, __LINE__,
 iscsi_scsi_cmd_decap() failed\n);
-		return -1;
+		result = -1;
+		goto out;
 	}
 	iscsi_trace(TRACE_ISCSI_DEBUG,
 		session %d: SCSI Command (CmdSN %u, op %#x)\n,
@@ -193,7 +197,8 @@
 			CmdSN(%d) of SCSI Command not valid, 
 			ExpCmdSN(%d) MaxCmdSN(%d). Ignoring the command\n,
 			scsi_cmd.CmdSN, sess-ExpCmdSN, sess-MaxCmdSN);
-		return 0;
+		result = 0;
+		goto out;
 	}
 	/* Arg check.   */
 	scsi_cmd.attr = 0;	/* Temp fix FIXME */
@@ -227,7 +232,8 @@
 			scsi_cmd.length (%u)  MaxRecvDataSegmentLength 
 			(%u)\n,
 			scsi_cmd.length, sess-sess_params.max_dataseg_len);
-		return -1;
+		result = -1;
+		goto out;
 	}
 
 #if 0
@@ -247,26 +253,21 @@
 		uint8_t  *ahs_ptr;
 		uint8_t   ahs_type;
 
-		scsi_cmd.ahs = NULL;
 		iscsi_trace(TRACE_ISCSI_DEBUG,
 reading %u bytes AHS\n, scsi_cmd.ahs_len);
 		scsi_cmd.ahs = iscsi_malloc_atomic((unsigned)scsi_cmd.ahs_len);
 		if (scsi_cmd.ahs == NULL) {
 			iscsi_err(__FILE__, __LINE__,
 iscsi_malloc_atomic() failed\n);
-			return -1;
+			result = -1;
+			goto out;
 		}
-#define AHS_CLEANUP do {		\
-	if (scsi_cmd.ahs != NULL) {	\
-		iscsi_free_atomic(scsi_cmd.ahs);			\
-	}\
-} while (/* CONSTCOND */ 0)
 		if (iscsi_sock_msg(sess-sock, 0, (unsigned)scsi_cmd.ahs_len,
 scsi_cmd.ahs, 0) != scsi_cmd.ahs_len) {
 			iscsi_err(__FILE__, __LINE__,
 iscsi_sock_msg() failed\n);
-			AHS_CLEANUP;
-			return -1;
+			result = -1;
+			goto out;
 		}
 		iscsi_trace(TRACE_ISCSI_DEBUG,
 read %u bytes AHS\n, scsi_cmd.ahs_len);
@@ -277,8 +278,8 @@
 			if (ahs_len == 0) {
 iscsi_err(__FILE__, __LINE__,
  		Zero ahs_len\n);
-AHS_CLEANUP;
-return -1;
+result = -1;
+goto out;
 			}
 			switch (ahs_type = *(ahs_ptr + 2)) {
 			case ISCSI_AHS_EXTENDED_CDB:
@@ -301,8 +302,8 @@
 			default:
 iscsi_err(__FILE__, __LINE__,
 	unknown AHS type %x\n, ahs_type);
-AHS_CLEANUP;
-return -1;
+result = -1;
+goto out;
 			}
 		}
 		iscsi_trace(TRACE_ISCSI_DEBUG,
@@ -328,24 +329,20 @@
 	if (device_command(sess, cmd) != 0) {
 		iscsi_err(__FILE__, __LINE__,
 device_command() failed\n);
-		AHS_CLEANUP;
-		return -1;
+		result = -1;
+		goto out;
 	}
 	/* Send any input data */
 
 	scsi_cmd.bytes_sent = 0;
 	if (!scsi_cmd.status  scsi_cmd.input) {
 		struct iovecsg_singleton;
-		struct iovec   *sg, *sg_orig, *sg_new = NULL;
+		struct iovec   *sg, *sg_orig;
 		int sg_len_orig, sg_len;
 		uint32_toffset, trans_len;
 		int fragment_flag = 0;
 		int offset_inc;
-#define SG_CLEANUP do {			\
-	if (fragment_flag) {		\
-		iscsi_free_atomic(sg_new);\
-	}\
-} while (/* CONSTCOND */ 0)
+
 		if (scsi_cmd.output) {
 			iscsi_trace(TRACE_ISCSI_DEBUG,
 sending %u bytes bi-directional input data\n,
@@ -384,8 +381,8 @@
 	sg_new = iscsi_malloc_atomic(sizeof(struct iovec) * sg_len_orig);
 	if (sg_new == NULL) {
 		iscsi_err(__FILE__, __LINE__, iscsi_malloc_atomic() failed\n);
-		AHS_CLEANUP;
-		return -1;
+		result = -1;
+		goto out;
 	}
 	fragment_flag++;
 }
@@ -394,9 +391,8 @@
 (void) memcpy(sg, sg_orig, sizeof(struct iovec) * sg_len_orig);
 if (modify_iov(sg, sg_len, offset, data.length) != 0) {
 	iscsi_err(__FILE__, __LINE__, modify_iov() failed\n);
-	SG_CLEANUP;
-	AHS_CLEANUP;
-	return -1;
+	result = -1;
+	goto out;
 }
 			}
 			iscsi_trace(TRACE_ISCSI_DEBUG, sending read data PDU (offset %u, len %u)\n, offset, data.length);
@@ -413,9 +409,8 @@
 }
 			} else if (offset + data.length  trans_len) {
 iscsi_err(__FILE__, __LINE__, offset+data.length  trans_len??\n);
-SG_CLEANUP;
-AHS_CLEANUP;
-return -1;
+result = -1;
+goto out;
 			}
 			data.task_tag = scsi_cmd.tag;
 			data.ExpCmdSN = sess-ExpCmdSN;

CVS commit: src/external/bsd/iscsi/dist/src/lib

2010-01-20 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Jan 20 10:33:08 UTC 2010

Modified Files:
src/external/bsd/iscsi/dist/src/lib: disk.c

Log Message:
implement REPORT LUNS for non-zero LUNs correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/iscsi/dist/src/lib/disk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/disk.c
diff -u src/external/bsd/iscsi/dist/src/lib/disk.c:1.4 src/external/bsd/iscsi/dist/src/lib/disk.c:1.5
--- src/external/bsd/iscsi/dist/src/lib/disk.c:1.4	Wed Jan 20 00:58:49 2010
+++ src/external/bsd/iscsi/dist/src/lib/disk.c	Wed Jan 20 10:33:08 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: disk.c,v 1.4 2010/01/20 00:58:49 yamt Exp $ */
+/* $NetBSD: disk.c,v 1.5 2010/01/20 10:33:08 yamt Exp $ */
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -765,15 +765,31 @@
 
 /* handle REPORT LUNs SCSI command */
 static int
-report_luns(uint64_t *data, int64_t luns)
+report_luns(uint8_t *data, uint64_t luns)
 {
-	uint64_t	i;
-	int32_t		off;
+	uint64_t i;
+	uint32_t len;
 
-	for (i = 0, off = 8 ; i  (uint64_t)luns ; i++, off += sizeof(i)) {
-		data[(int)i] = ISCSI_HTONLL(i);
+	len = 8;
+	for (i = 0; i  luns; i++) {
+		uint8_t *p = data[len];
+
+		if (i  256) {
+			memset(p, 0, 8);
+			p[1] = (uint8_t)(i  0xff);
+			len += 8;
+		} else if (i  16384) {
+			memset(p, 0, 8);
+			p[0] = (uint8_t)(0x40 | ((i  8)  0x3f));
+			p[1] = (uint8_t)(i  0xff);
+			len += 8;
+		} else {
+			/* XXX */
+		}
 	}
-	return off;
+	*((uint32_t *)(void *)data) = ISCSI_HTONL(len - 8);
+	memset(data[4], 0, 4);
+	return len;
 }
 
 /* handle persistent reserve in command */
@@ -1309,12 +1325,8 @@
 
 	case REPORT_LUNS:
 		iscsi_trace(TRACE_SCSI_CMD, REPORT LUNS\n);
-		args-length = report_luns(
-(uint64_t *)(void *)args-send_data[8],
-(off_t)disks.v[sess-d].luns);
-		*((uint32_t *)(void *)args-send_data) =
-ISCSI_HTONL(disks.v[sess-d].luns *
-sizeof(uint64_t));
+		args-length = report_luns(args-send_data,
+disks.v[sess-d].luns);
 		args-input = 8;
 		args-status = SCSI_SUCCESS;
 		break;



CVS commit: src/external/bsd/iscsi/dist/src/lib

2010-01-20 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Jan 20 11:50:29 UTC 2010

Modified Files:
src/external/bsd/iscsi/dist/src/lib: target.c

Log Message:
- remove unnecessary and confusing initialization of sess-d.
- add an assertion.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/iscsi/dist/src/lib/target.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/target.c
diff -u src/external/bsd/iscsi/dist/src/lib/target.c:1.4 src/external/bsd/iscsi/dist/src/lib/target.c:1.5
--- src/external/bsd/iscsi/dist/src/lib/target.c:1.4	Wed Jan 20 00:58:49 2010
+++ src/external/bsd/iscsi/dist/src/lib/target.c	Wed Jan 20 11:50:28 2010
@@ -43,6 +43,7 @@
 #include sys/types.h
 #include sys/param.h
 
+#include assert.h
 #include stdlib.h
 
 #ifdef HAVE_NETINET_TCP_H
@@ -1545,6 +1546,7 @@
 
 	ISCSI_LOCK(g_session_q_mutex, return -1);
 	(void) memset(sess, 0x0, sizeof(*sess));
+	sess-d = -1;
 	if (iscsi_queue_insert(g_session_q, sess) != 0) {
 		iscsi_err(__FILE__, __LINE__,
 iscsi_queue_insert() failed\n);
@@ -1988,6 +1990,7 @@
 	tgt-main_pid = getpid();
 	for (i = 0; i  maxsessions; i++) {
 		g_session[i].id = i;
+		g_session[i].d = -1;
 		if (iscsi_queue_insert(g_session_q, g_session[i]) != 0) {
 			iscsi_err(__FILE__, __LINE__,
 iscsi_queue_insert() failed\n);
@@ -1995,8 +1998,9 @@
 		}
 	}
 	for (j = 0 ; j  lunv-c ; j++) {
-		g_session[j].d = device_init(tgt, lunv, lunv-v[j]);
-		if (g_session[j].d  0) {
+		int d = device_init(tgt, lunv, lunv-v[j]);
+
+		if (d  0) {
 			iscsi_err(__FILE__, __LINE__,
 device_init() failed\n);
 			return -1;
@@ -2131,6 +2135,7 @@
 			goto done;
 		}
 		ISCSI_UNLOCK(g_session_q_mutex, return -1);
+		assert(sess-d == -1);
 #if 0
 		(void) memset(sess, 0x0, sizeof(*sess));
 #endif



CVS commit: src/external/bsd/iscsi/dist/src/lib

2010-01-19 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Jan 20 00:50:09 UTC 2010

Modified Files:
src/external/bsd/iscsi/dist/src/lib: disk.c

Log Message:
disk_write: report an error from target_transfer_data instead of
silently write garbage to the storage.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/iscsi/dist/src/lib/disk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/disk.c
diff -u src/external/bsd/iscsi/dist/src/lib/disk.c:1.2 src/external/bsd/iscsi/dist/src/lib/disk.c:1.3
--- src/external/bsd/iscsi/dist/src/lib/disk.c:1.2	Tue Jun 30 02:44:52 2009
+++ src/external/bsd/iscsi/dist/src/lib/disk.c	Wed Jan 20 00:50:09 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: disk.c,v 1.2 2009/06/30 02:44:52 agc Exp $ */
+/* $NetBSD: disk.c,v 1.3 2010/01/20 00:50:09 yamt Exp $ */
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -1398,6 +1398,7 @@
 	if (target_transfer_data(sess, args, sg, 1) != 0) {
 		iscsi_err(__FILE__, __LINE__,
 			target_transfer_data() failed\n);
+		return -1;
 	}
 	/* Finish up write */
 	if (de_lseek(disks.v[sess-d].lunv-v[lun].de, (off_t)byte_offset,



CVS commit: src/external/bsd/iscsi/dist/src/lib

2010-01-19 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Jan 20 00:51:51 UTC 2010

Modified Files:
src/external/bsd/iscsi/dist/src/lib: target.c

Log Message:
target_transfer_data: fix an incorrect flattening of RETURN_NOT_EQUAL
in rev.1.2.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/iscsi/dist/src/lib/target.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/target.c
diff -u src/external/bsd/iscsi/dist/src/lib/target.c:1.2 src/external/bsd/iscsi/dist/src/lib/target.c:1.3
--- src/external/bsd/iscsi/dist/src/lib/target.c:1.2	Tue Jun 30 02:44:52 2009
+++ src/external/bsd/iscsi/dist/src/lib/target.c	Wed Jan 20 00:51:51 2010
@@ -1841,8 +1841,8 @@
 #if 0
 		RETURN_NOT_EQUAL(Final bit, args-final, 1, TTD_CLEANUP, -1);
 #else
-		if (data.final != 1) {
-			iscsi_err(__FILE__, __LINE__, Final bit);
+		if (args-final != 1) {
+			iscsi_err(__FILE__, __LINE__, Final bit\n);
 			TTD_CLEANUP;
 			return -1;
 		}



CVS commit: src/external/bsd/iscsi/dist/src/lib

2010-01-19 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Jan 20 00:58:49 UTC 2010

Modified Files:
src/external/bsd/iscsi/dist/src/lib: disk.c target.c

Log Message:
add missing trailing newline chars to some of iscsi_err messages.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/iscsi/dist/src/lib/disk.c \
src/external/bsd/iscsi/dist/src/lib/target.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/disk.c
diff -u src/external/bsd/iscsi/dist/src/lib/disk.c:1.3 src/external/bsd/iscsi/dist/src/lib/disk.c:1.4
--- src/external/bsd/iscsi/dist/src/lib/disk.c:1.3	Wed Jan 20 00:50:09 2010
+++ src/external/bsd/iscsi/dist/src/lib/disk.c	Wed Jan 20 00:58:49 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: disk.c,v 1.3 2010/01/20 00:50:09 yamt Exp $ */
+/* $NetBSD: disk.c,v 1.4 2010/01/20 00:58:49 yamt Exp $ */
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -715,12 +715,12 @@
 	}
 	if (de_read(de, block, sizeof(block)) == -1) {
 		iscsi_err(__FILE__, __LINE__,
-error reading \%s\, filename);
+error reading \%s\\n, filename);
 		return 0;
 	}
 	if (de_write(de, block, sizeof(block)) == -1) {
 		iscsi_err(__FILE__, __LINE__,
-error writing \%s\, filename);
+error writing \%s\\n, filename);
 		return 0;
 	}
 	return 1;
@@ -863,7 +863,7 @@
 	}
 	if (!(tp-flags  TARGET_READONLY)  !allocate_space(tp)) {
 		iscsi_err(__FILE__, __LINE__,
-			error allocating space for \%s\, tp-target);
+			error allocating space for \%s\\n, tp-target);
 		return -1;
 	}
 	printf(% PRIu64  MB %sdisk storage for \%s\\n,
Index: src/external/bsd/iscsi/dist/src/lib/target.c
diff -u src/external/bsd/iscsi/dist/src/lib/target.c:1.3 src/external/bsd/iscsi/dist/src/lib/target.c:1.4
--- src/external/bsd/iscsi/dist/src/lib/target.c:1.3	Wed Jan 20 00:51:51 2010
+++ src/external/bsd/iscsi/dist/src/lib/target.c	Wed Jan 20 00:58:49 2010
@@ -1832,7 +1832,7 @@
 		RETURN_NOT_EQUAL(Final bit, data.final, 1, TTD_CLEANUP, -1);
 #else
 		if (data.final != 1) {
-			iscsi_err(__FILE__, __LINE__, Final bit);
+			iscsi_err(__FILE__, __LINE__, Final bit\n);
 			TTD_CLEANUP;
 			return -1;
 		}



CVS commit: src/external/bsd/iscsi/dist/src/lib

2009-07-15 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Jul 15 09:50:08 UTC 2009

Modified Files:
src/external/bsd/iscsi/dist/src/lib: libiscsi.3

Log Message:
.Xr takes exactly two arguments plus separators, so fix the use here.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/iscsi/dist/src/lib/libiscsi.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/libiscsi.3
diff -u src/external/bsd/iscsi/dist/src/lib/libiscsi.3:1.2 src/external/bsd/iscsi/dist/src/lib/libiscsi.3:1.3
--- src/external/bsd/iscsi/dist/src/lib/libiscsi.3:1.2	Tue Jun 30 02:44:52 2009
+++ src/external/bsd/iscsi/dist/src/lib/libiscsi.3	Wed Jul 15 09:50:08 2009
@@ -1,4 +1,4 @@
-.\ $NetBSD: libiscsi.3,v 1.2 2009/06/30 02:44:52 agc Exp $
+.\ $NetBSD: libiscsi.3,v 1.3 2009/07/15 09:50:08 joerg Exp $
 .\
 .\ Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -97,7 +97,8 @@
 The corresponding command line utilities for
 .Nm
 are
-.Xr iscsi-initiator 8 and
+.Xr iscsi-initiator 8
+and
 .Xr iscsi-target 8 .
 .Pp
 In normal operation, a process acting as