lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 28 Sep 2011 20:30:15 -0400
From:	Theodore Ts'o <tytso@....edu>
To:	Ext4 Developers List <linux-ext4@...r.kernel.org>
Cc:	Theodore Ts'o <tytso@....edu>,
	"Darrick J. Wong" <djwong@...ibm.com>
Subject: [PATCH 2/2] libext2fs: use ext2fs byte swap functions for portability

The functions htole32(), le32toh(), be32toh(), htobe32() aren't
defined in all environments.  Use the ext2fs byte swap functions for
portability.

Signed-off-by: "Theodore Ts'o" <tytso@....edu>
---
 lib/ext2fs/crc32c_defs.h |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/ext2fs/crc32c_defs.h b/lib/ext2fs/crc32c_defs.h
index 1752970..ced4f67 100644
--- a/lib/ext2fs/crc32c_defs.h
+++ b/lib/ext2fs/crc32c_defs.h
@@ -42,18 +42,19 @@
 		(((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24)))
 
 
+#include "ext2fs.h"
 #ifdef WORDS_BIGENDIAN
 #define __constant_cpu_to_le32(x) ___constant_swab32((x))
 #define __constant_cpu_to_be32(x) (x)
 #define __be32_to_cpu(x) (x)
 #define __cpu_to_be32(x) (x)
-#define __cpu_to_le32(x) (htole32((x)))
-#define __le32_to_cpu(x) (le32toh((x)))
+#define __cpu_to_le32(x) (ext2fs_cpu_to_le32((x)))
+#define __le32_to_cpu(x) (ext2fs_le32_to_cpu((x)))
 #else
 #define __constant_cpu_to_le32(x) (x)
 #define __constant_cpu_to_be32(x) ___constant_swab32((x))
-#define __be32_to_cpu(x) (be32toh((x)))
-#define __cpu_to_be32(x) (htobe32((x)))
+#define __be32_to_cpu(x) (ext2fs_be32_to_cpu((x)))
+#define __cpu_to_be32(x) (ext2fs_cpu_to_be32((x)))
 #define __cpu_to_le32(x) (x)
 #define __le32_to_cpu(x) (x)
 #endif
-- 
1.7.4.1.22.gec8e1.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists