Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jun 2011 09:40:13 -0700
From:      Garrett Cooper <yanegomi@gmail.com>
To:        sam@FreeBSD.org
Cc:        freebsd-hackers@freebsd.org
Subject:   [PATCH] do bswap32 properly with safe(4)
Message-ID:  <BANLkTi=n0kZPBZWmtDfLOmaAzqPbwmB7Dg@mail.gmail.com>

index | next in thread | raw e-mail

[-- Attachment #1 --]
Hi Sam!
    For some odd reason every time I compile GENERIC (i.e. don't try
to compile safe(4) as a standalone module, and I don't compile it with
my standard test kernel) I run into an error where the compiler
complains about the result from bswap32 in safe(4) being unused.
    This patch fixes that warning so the module compiles properly and
more importantly does the network to host conversions which may be
required for the driver under some architectures.
Thanks!
-Garrett

[-- Attachment #2 --]
Index: sys/dev/safe/safe.c
===================================================================
--- sys/dev/safe/safe.c	(revision 222980)
+++ sys/dev/safe/safe.c	(working copy)
@@ -1580,9 +1580,12 @@
 				 * SHA-1 ICV's are byte-swapped; fix 'em up
 				 * before copy them to their destination.
 				 */
-				bswap32(re->re_sastate.sa_saved_indigest[0]);
-				bswap32(re->re_sastate.sa_saved_indigest[1]);
-				bswap32(re->re_sastate.sa_saved_indigest[2]);
+				re->re_sastate.sa_saved_indigest[0] =
+				    bswap32(re->re_sastate.sa_saved_indigest[0]);
+				re->re_sastate.sa_saved_indigest[1] =
+				    bswap32(re->re_sastate.sa_saved_indigest[1]);
+				re->re_sastate.sa_saved_indigest[2] =
+				    bswap32(re->re_sastate.sa_saved_indigest[2]);
 			}
 			crypto_copyback(crp->crp_flags, crp->crp_buf,
 			    crd->crd_inject,
help

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