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;
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to