From c817daa74ae52cd0bb64b14050b52bc6b3308698 Mon Sep 17 00:00:00 2001 From: Andrew Yourtchenko Date: Tue, 20 Jun 2017 13:54:57 +0200 Subject: acl-plugin: the second and subsequent ACEs incorrect endianness when custom-dump and in VAT (VPP-885) Add the missing function to convert the entire array of rules in the respective _endian functions, rather than just the first rule. Change-Id: Ic057f27ff7ec20150595efca1a48b74e5850f52b Signed-off-by: Andrew Yourtchenko --- src/plugins/acl/manual_fns.h | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/plugins/acl/manual_fns.h b/src/plugins/acl/manual_fns.h index a2620fb2..c37d14b6 100644 --- a/src/plugins/acl/manual_fns.h +++ b/src/plugins/acl/manual_fns.h @@ -25,6 +25,24 @@ vl_print (handle, (char *)s); \ vec_free (s); +static inline void +vl_api_acl_rule_t_array_endian(vl_api_acl_rule_t *rules, u32 count) +{ + u32 i; + for(i=0; iacl_index = clib_net_to_host_u32 (a->acl_index); /* a->tag[0..63] = a->tag[0..63] (no-op) */ a->count = clib_net_to_host_u32 (a->count); - vl_api_acl_rule_t_endian (a->r); + vl_api_acl_rule_t_array_endian (a->r, a->count); } static inline void @@ -44,7 +62,7 @@ vl_api_macip_acl_details_t_endian (vl_api_macip_acl_details_t * a) a->acl_index = clib_net_to_host_u32 (a->acl_index); /* a->tag[0..63] = a->tag[0..63] (no-op) */ a->count = clib_net_to_host_u32 (a->count); - vl_api_macip_acl_rule_t_endian (a->r); + vl_api_macip_acl_rule_t_array_endian (a->r, a->count); } @@ -57,7 +75,7 @@ vl_api_acl_add_replace_t_endian (vl_api_acl_add_replace_t * a) a->acl_index = clib_net_to_host_u32 (a->acl_index); /* a->tag[0..63] = a->tag[0..63] (no-op) */ a->count = clib_net_to_host_u32 (a->count); - vl_api_acl_rule_t_endian (a->r); + vl_api_acl_rule_t_array_endian (a->r, a->count); } static inline void @@ -68,7 +86,7 @@ vl_api_macip_acl_add_t_endian (vl_api_macip_acl_add_t * a) a->context = clib_net_to_host_u32 (a->context); /* a->tag[0..63] = a->tag[0..63] (no-op) */ a->count = clib_net_to_host_u32 (a->count); - vl_api_macip_acl_rule_t_endian (a->r); + vl_api_macip_acl_rule_t_array_endian (a->r, a->count); } static inline u8 * -- cgit 1.2.3-korg