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

2023-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Dec 19 02:16:07 UTC 2023

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

Log Message:
libiscsi: Fix types of Time2Wait and Time2Retain in logout decap.

According to https://www.rfc-editor.org/rfc/rfc7143#section-11.15,
these are both 2-byte quantities.  Loading 4-byte quantities and
passing them through ISCSI_NTOHS might have worked by accident on
x86, but it's not gonna fly on big-endian.  (Fortunately sparc64 is
not just big-endian but also strict-alignment so it caught this
problem!)

XXX Is there an upstream for this code?  doc/3RDPARTY doesn't cite
any easily-followed references.

PR port-sparc64/57784

XXX pullup-10
XXX pullup-9
XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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/protocol.c
diff -u src/external/bsd/iscsi/dist/src/lib/protocol.c:1.4 src/external/bsd/iscsi/dist/src/lib/protocol.c:1.5
--- src/external/bsd/iscsi/dist/src/lib/protocol.c:1.4	Sat Sep 29 07:18:21 2012
+++ src/external/bsd/iscsi/dist/src/lib/protocol.c	Tue Dec 19 02:16:07 2023
@@ -920,8 +920,8 @@ iscsi_logout_rsp_decap(uint8_t *header, 
 	rsp->StatSN = ISCSI_NTOHL(*((uint32_t *) (void *) (header + 24)));	/* StatSN */
 	rsp->ExpCmdSN = ISCSI_NTOHL(*((uint32_t *) (void *) (header + 28)));	/* ExpCmdSN */
 	rsp->MaxCmdSN = ISCSI_NTOHL(*((uint32_t *) (void *) (header + 32)));	/* MaxCmdSN  */
-	rsp->Time2Wait = ISCSI_NTOHS(*((uint32_t *) (void *) (header + 40)));	/* Time2Wait */
-	rsp->Time2Retain = ISCSI_NTOHS(*((uint32_t *) (void *) (header + 42)));	/* Time2Retain */
+	rsp->Time2Wait = ISCSI_NTOHS(*((uint16_t *) (void *) (header + 40)));	/* Time2Wait */
+	rsp->Time2Retain = ISCSI_NTOHS(*((uint16_t *) (void *) (header + 42)));	/* Time2Retain */
 
 	errmsg = NULL;
 	(void) memset(zeros, 0x0, sizeof(zeros));



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

2023-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Dec 19 02:16:07 UTC 2023

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

Log Message:
libiscsi: Fix types of Time2Wait and Time2Retain in logout decap.

According to https://www.rfc-editor.org/rfc/rfc7143#section-11.15,
these are both 2-byte quantities.  Loading 4-byte quantities and
passing them through ISCSI_NTOHS might have worked by accident on
x86, but it's not gonna fly on big-endian.  (Fortunately sparc64 is
not just big-endian but also strict-alignment so it caught this
problem!)

XXX Is there an upstream for this code?  doc/3RDPARTY doesn't cite
any easily-followed references.

PR port-sparc64/57784

XXX pullup-10
XXX pullup-9
XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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.



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

2023-08-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug  3 08:00:10 UTC 2023

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

Log Message:
log a pointer's value before calling free() on it.  avoids technical UB.

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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.



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

2023-08-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug  3 08:00:10 UTC 2023

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

Log Message:
log a pointer's value before calling free() on it.  avoids technical UB.

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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.4 src/external/bsd/iscsi/dist/src/lib/util.c:1.5
--- src/external/bsd/iscsi/dist/src/lib/util.c:1.4	Thu Oct 24 19:13:25 2013
+++ src/external/bsd/iscsi/dist/src/lib/util.c	Thu Aug  3 08:00:10 2023
@@ -134,15 +134,15 @@ iscsi_malloc(unsigned n)
 void 
 iscsi_free_atomic(void *ptr)
 {
-	(void) free(ptr);
 	iscsi_trace(TRACE_MEM, "iscsi_free_atomic(%p)\n", ptr);
+	(void) free(ptr);
 }
 
 void 
 iscsi_free(void *ptr)
 {
-	(void) free(ptr);
 	iscsi_trace(TRACE_MEM, "iscsi_free(%p)\n", ptr);
+	(void) free(ptr);
 }
 
 /* debugging levels */



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

2019-10-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Oct  8 20:02:45 UTC 2019

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

Log Message:
grow the buffer.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 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.



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

2019-10-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Oct  8 20:02:45 UTC 2019

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

Log Message:
grow the buffer.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 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.9 src/external/bsd/iscsi/dist/src/lib/target.c:1.10
--- src/external/bsd/iscsi/dist/src/lib/target.c:1.9	Fri Nov 14 20:15:45 2014
+++ src/external/bsd/iscsi/dist/src/lib/target.c	Tue Oct  8 16:02:44 2019
@@ -2089,7 +2089,7 @@ iscsi_target_listen(iscsi_target_t *tgt)
 	target_session_t	*sess;
 	socklen_t		remoteAddrLen;
 	socklen_t		localAddrLen;
-	char			targetaddress[1024];
+	char			targetaddress[2 * 1024];
 	char			remote[1024];
 	char			local[1024];
 	char			*config;



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.



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.



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.



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.



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.



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.