session: api to add new transport types
[vpp.git] / src / vnet / session / mma_template.c
index 15fd7c7..ae730e5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Copyright (c) 2017-2019 Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
@@ -60,8 +60,8 @@ RTT (mma_rule) * RT (mma_rules_table_rule_alloc) (RTT (mma_rules_table) * srt)
 RTT (mma_rule) *
 RT (mma_rule_free) (RTT (mma_rules_table) * srt, RTT (mma_rule) * rule)
 {
-  pool_put (srt->rules, rule);
   clib_memset (rule, 0xfa, sizeof (*rule));
+  pool_put (srt->rules, rule);
   return rule;
 }
 
@@ -238,7 +238,7 @@ RT (mma_rules_table_del_rule) (RTT (mma_rules_table) * srt,
          if (i != 0)
            {
              vec_add2 (next_indices, new_elts, i);
-             clib_memcpy (new_elts, rp->next_indices, i * sizeof (u32));
+             clib_memcpy_fast (new_elts, rp->next_indices, i * sizeof (u32));
            }
          if (vec_len (child->next_indices))
            vec_append (next_indices, child->next_indices);
@@ -246,8 +246,8 @@ RT (mma_rules_table_del_rule) (RTT (mma_rules_table) * srt,
          if (left_to_add)
            {
              vec_add2 (next_indices, new_elts, left_to_add);
-             clib_memcpy (new_elts, &rp->next_indices[i + 1],
-                          left_to_add * sizeof (u32));
+             clib_memcpy_fast (new_elts, &rp->next_indices[i + 1],
+                               left_to_add * sizeof (u32));
            }
          RT (mma_rule_free) (srt, child);
          vec_free (rp->next_indices);