aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAndrew Yourtchenko <ayourtch@gmail.com>2017-06-20 13:54:57 +0200
committerOle Trøan <otroan@employees.org>2017-06-21 20:31:54 +0000
commitc817daa74ae52cd0bb64b14050b52bc6b3308698 (patch)
tree3bdb69685174138084a597821eb76f0d86dd0226 /src/plugins
parenteb46754ef6b3efd958a11ea2f0b110eb99ce3b27 (diff)
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 <ayourtch@gmail.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/acl/manual_fns.h26
1 files changed, 22 insertions, 4 deletions
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
@@ -26,6 +26,24 @@
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; i<count; i++) {
+ vl_api_acl_rule_t_endian (&rules[i]);
+ }
+}
+
+static inline void
+vl_api_macip_acl_rule_t_array_endian(vl_api_macip_acl_rule_t *rules, u32 count)
+{
+ u32 i;
+ for(i=0; i<count; i++) {
+ vl_api_macip_acl_rule_t_endian (&rules[i]);
+ }
+}
+
+static inline void
vl_api_acl_details_t_endian (vl_api_acl_details_t * a)
{
a->_vl_msg_id = clib_net_to_host_u16 (a->_vl_msg_id);
@@ -33,7 +51,7 @@ vl_api_acl_details_t_endian (vl_api_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_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 *