From 8df4baae1eac47c3a1c88bf7cdaedde95695a208 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Wed, 15 Dec 2021 12:59:26 +0000 Subject: api: Fix reaper functions for socket clients Type: fix The pub_sub_handler() stores registrations key'd with the message's client_index (which is in network-order). The socket-client invokes the reaper function (to cleanup these registrations) using the pool index of the registration. hence the pub-sub registration is not removed. change the socket-client to pass the network-order client_index. This approach was chosen in preference to chaning the way the registrations are key'd since the memory-client also uses this registration, and correclty passes the client_index to the reaper. Signed-off-by: Neale Ranns Change-Id: I6118555c8601149d05801f558e08bcc7aed4fc98 --- src/vlibmemory/socket_api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/vlibmemory') diff --git a/src/vlibmemory/socket_api.c b/src/vlibmemory/socket_api.c index 3e3f7d5bc04..9f9773ead1d 100644 --- a/src/vlibmemory/socket_api.c +++ b/src/vlibmemory/socket_api.c @@ -183,7 +183,8 @@ vl_socket_free_registration_index (u32 pool_index) } rp = pool_elt_at_index (socket_main.registration_pool, pool_index); - vl_api_call_reaper_functions (pool_index); + vl_api_call_reaper_functions ( + clib_host_to_net_u32 (sock_api_registration_handle (rp))); ASSERT (rp->registration_type != REGISTRATION_TYPE_FREE); for (i = 0; i < vec_len (rp->additional_fds_to_close); i++) -- cgit 1.2.3-korg