Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jan 2014 11:03:57 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r260389 - head/sys/dev/iscsi
Message-ID:  <201401071103.s07B3vV7066357@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Tue Jan  7 11:03:57 2014
New Revision: 260389
URL: http://svnweb.freebsd.org/changeset/base/260389

Log:
  Fix a rare "truncated checksums" problem, which manifested like this:
  
  WARNING: icl_pdu_check_data_digest: data digest check failed; got 0xf23b,
      should be 0xdb7f23b
  
  Tested by:	Darcy Birkbeck
  MFC after:	2 weeks
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/dev/iscsi/icl.c

Modified: head/sys/dev/iscsi/icl.c
==============================================================================
--- head/sys/dev/iscsi/icl.c	Tue Jan  7 09:52:26 2014	(r260388)
+++ head/sys/dev/iscsi/icl.c	Tue Jan  7 11:03:57 2014	(r260389)
@@ -324,7 +324,7 @@ icl_pdu_check_header_digest(struct icl_p
 	}
 
 	CTASSERT(sizeof(received_digest) == ISCSI_HEADER_DIGEST_SIZE);
-	memcpy(&received_digest, mtod(m, void *), ISCSI_HEADER_DIGEST_SIZE);
+	m_copydata(m, 0, ISCSI_HEADER_DIGEST_SIZE, (void *)&received_digest);
 	m_freem(m);
 
 	*availablep -= ISCSI_HEADER_DIGEST_SIZE;
@@ -482,7 +482,7 @@ icl_pdu_check_data_digest(struct icl_pdu
 	}
 
 	CTASSERT(sizeof(received_digest) == ISCSI_DATA_DIGEST_SIZE);
-	memcpy(&received_digest, mtod(m, void *), ISCSI_DATA_DIGEST_SIZE);
+	m_copydata(m, 0, ISCSI_DATA_DIGEST_SIZE, (void *)&received_digest);
 	m_freem(m);
 
 	*availablep -= ISCSI_DATA_DIGEST_SIZE;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401071103.s07B3vV7066357>