misc: move to new pool_foreach macros
[vpp.git] / src / vlibmemory / socket_api.c
index 51c52b4..a5fb86b 100644 (file)
@@ -85,13 +85,13 @@ vl_sock_api_dump_clients (vlib_main_t * vm, api_main_t * am)
   vlib_cli_output (vm, "Socket clients");
   vlib_cli_output (vm, "%20s %8s", "Name", "Fildesc");
     /* *INDENT-OFF* */
-    pool_foreach (reg, sm->registration_pool,
-    ({
+    pool_foreach (reg, sm->registration_pool)
+     {
         if (reg->registration_type == REGISTRATION_TYPE_SOCKET_SERVER) {
             f = vl_api_registration_file (reg);
             vlib_cli_output (vm, "%20s %8d", reg->name, f->file_descriptor);
         }
-    }));
+    }
 /* *INDENT-ON* */
 }
 
@@ -645,6 +645,11 @@ vl_api_sock_init_shm_t_handler (vl_api_sock_init_shm_t * mp)
   if ((rv = ssvm_server_init_memfd (memfd)))
     goto reply;
 
+  /* delete the unused heap created in ssvm_server_init_memfd and mark it
+   * accessible again for ASAN */
+  clib_mem_destroy_heap (memfd->sh->heap);
+  CLIB_MEM_UNPOISON ((void *) memfd->sh->ssvm_va, memfd->ssvm_size);
+
   /* Remember to close this fd when the socket connection goes away */
   vec_add1 (regp->additional_fds_to_close, memfd->fd);
 
@@ -779,11 +784,11 @@ socket_exit (vlib_main_t * vm)
     {
       u32 index;
         /* *INDENT-OFF* */
-        pool_foreach (rp, sm->registration_pool, ({
+        pool_foreach (rp, sm->registration_pool)  {
           vl_api_registration_del_file (rp);
           index = rp->vl_api_registration_pool_index;
           vl_socket_free_registration_index (index);
-        }));
+        }
 /* *INDENT-ON* */
     }