session: cleanup part 1
[vpp.git] / src / vnet / session / session_table.c
index 5d160a4..da3e4cd 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:
@@ -32,7 +32,7 @@ session_table_alloc (void)
 {
   session_table_t *slt;
   pool_get_aligned (lookup_tables, slt, CLIB_CACHE_LINE_BYTES);
-  memset (slt, 0, sizeof (*slt));
+  clib_memset (slt, 0, sizeof (*slt));
   return slt;
 }
 
@@ -45,9 +45,9 @@ session_table_index (session_table_t * slt)
 session_table_t *
 session_table_get (u32 table_index)
 {
-  if (vec_len (lookup_tables) <= table_index)
+  if (pool_is_free_index (lookup_tables, table_index))
     return 0;
-  return vec_elt_at_index (lookup_tables, table_index);
+  return pool_elt_at_index (lookup_tables, table_index);
 }
 
 #define foreach_hash_table_parameter            \