Wed Oct 8 14:58:57 2008 UTC ()
memset to zero the entire nop_in structure.  Fixes PR#39688 by
Henning Petersen.  Thanks!


(oster)
diff -r1.23 -r1.24 src/dist/iscsi/src/target.c

cvs diff -r1.23 -r1.24 src/dist/iscsi/src/Attic/target.c (expand / switch to unified diff)

--- src/dist/iscsi/src/Attic/target.c 2008/02/07 19:09:02 1.23
+++ src/dist/iscsi/src/Attic/target.c 2008/10/08 14:58:57 1.24
@@ -539,27 +539,27 @@ nop_out_t(target_session_t * sess, uint8 @@ -539,27 +539,27 @@ nop_out_t(target_session_t * sess, uint8
539 if (ping_data) { 539 if (ping_data) {
540 iscsi_free(ping_data); 540 iscsi_free(ping_data);
541 } 541 }
542 return -1; 542 return -1;
543 } 543 }
544 iscsi_trace(TRACE_ISCSI_DEBUG, __FILE__, __LINE__, "successfully read %d bytes ping data:\n", nop_out.length); 544 iscsi_trace(TRACE_ISCSI_DEBUG, __FILE__, __LINE__, "successfully read %d bytes ping data:\n", nop_out.length);
545 iscsi_print_buffer(ping_data, nop_out.length); 545 iscsi_print_buffer(ping_data, nop_out.length);
546 } 546 }
547 if (nop_out.tag != 0xffffffff) { 547 if (nop_out.tag != 0xffffffff) {
548 iscsi_nop_in_args_t nop_in; 548 iscsi_nop_in_args_t nop_in;
549 uint8_t rsp_header[ISCSI_HEADER_LEN]; 549 uint8_t rsp_header[ISCSI_HEADER_LEN];
550 550
551 iscsi_trace(TRACE_ISCSI_DEBUG, __FILE__, __LINE__, "sending %d bytes ping response\n", nop_out.length); 551 iscsi_trace(TRACE_ISCSI_DEBUG, __FILE__, __LINE__, "sending %d bytes ping response\n", nop_out.length);
552 (void) memset(&nop_in, 0x0, sizeof(&nop_in)); 552 (void) memset(&nop_in, 0x0, sizeof(nop_in));
553 nop_in.length = nop_out.length; 553 nop_in.length = nop_out.length;
554 nop_in.lun = nop_out.lun; 554 nop_in.lun = nop_out.lun;
555 nop_in.tag = nop_out.tag; 555 nop_in.tag = nop_out.tag;
556 nop_in.transfer_tag = 0xffffffff; 556 nop_in.transfer_tag = 0xffffffff;
557 nop_in.StatSN = ++(sess->StatSN); 557 nop_in.StatSN = ++(sess->StatSN);
558 nop_in.ExpCmdSN = sess->ExpCmdSN; 558 nop_in.ExpCmdSN = sess->ExpCmdSN;
559 nop_in.MaxCmdSN = sess->MaxCmdSN; 559 nop_in.MaxCmdSN = sess->MaxCmdSN;
560 560
561 if (iscsi_nop_in_encap(rsp_header, &nop_in) != 0) { 561 if (iscsi_nop_in_encap(rsp_header, &nop_in) != 0) {
562 iscsi_trace_error(__FILE__, __LINE__, "iscsi_nop_in_encap() failed\n"); 562 iscsi_trace_error(__FILE__, __LINE__, "iscsi_nop_in_encap() failed\n");
563 if (ping_data) { 563 if (ping_data) {
564 iscsi_free(ping_data); 564 iscsi_free(ping_data);
565 } 565 }