[PATCH 05/27] netlink: decode crypto_user_alg attributes of CRYPTOCFGA_PRIORITY_VAL

JingPiao Chen chenjingpiao at gmail.com
Sat Jul 22 12:43:35 UTC 2017


* netlink_crypto.c (crypto_user_alg_nla_decoders): New array.
(decode_crypto_user_alg): Use it.
---
 netlink_crypto.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/netlink_crypto.c b/netlink_crypto.c
index 62550b2..e39fdfc 100644
--- a/netlink_crypto.c
+++ b/netlink_crypto.c
@@ -37,6 +37,10 @@
 
 # include "xlat/crypto_nl_attrs.h"
 
+static const nla_decoder_t crypto_user_alg_nla_decoders[] = {
+	[CRYPTOCFGA_PRIORITY_VAL]	= decode_nla_u32
+};
+
 static void
 decode_crypto_user_alg(struct tcb *const tcp,
 		       const kernel_ulong_t addr,
@@ -61,7 +65,9 @@ decode_crypto_user_alg(struct tcb *const tcp,
 			tprints(", ");
 			decode_nlattr(tcp, addr + offset, len - offset,
 				      crypto_nl_attrs, "CRYPTOCFGA_???",
-				      NULL, 0, NULL);
+				      crypto_user_alg_nla_decoders,
+				      ARRAY_SIZE(crypto_user_alg_nla_decoders),
+				      NULL);
 		}
 	}
 }
-- 
2.7.4





More information about the Strace-devel mailing list