summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch')
-rw-r--r--meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
new file mode 100644
index 0000000000..2320b92eba
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
@@ -0,0 +1,41 @@
1From 0c4dbadc9db3cda1cfca64e44ea08c6e89919ea7 Mon Sep 17 00:00:00 2001
2From: Ting Liu <b28495@freescale.com>
3Date: Tue, 10 Sep 2013 13:44:18 +0800
4Subject: [PATCH] Change to calling bswap_* instead of htobe* and be*toh
5
6We can't use htobe* and be*toh functions because they are not
7available on older versions of glibc, For example, shipped on Centos 5.5.
8
9Change to directly calling bswap_* as defined in+byteswap.h.
10
11Upstream-Status: Inappropriate
12
13Signed-off-by: Ting Liu <b28495@freescale.com>
14---
15 libkmod/libkmod-signature.c | 3 ++-
16 1 files changed, 2 insertions(+), 1 deletions(-)
17
18diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
19index 6b80caa..3544a36 100644
20--- a/libkmod/libkmod-signature.c
21+++ b/libkmod/libkmod-signature.c
22@@ -19,6 +19,7 @@
23 */
24
25 #include <endian.h>
26+#include <byteswap.h>
27 #include <stdint.h>
28 #include <stdlib.h>
29 #include <string.h>
30@@ -121,7 +122,7 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat
31 modsig->hash >= PKEY_HASH__LAST ||
32 modsig->id_type >= PKEY_ID_TYPE__LAST)
33 return false;
34- sig_len = be32toh(get_unaligned(&modsig->sig_len));
35+ sig_len = bswap_32(get_unaligned(&modsig->sig_len));
36 if (size < (off_t)(modsig->signer_len + modsig->key_id_len + sig_len))
37 return false;
38
39--
401.7.5.4
41