aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-08-06 12:19:29 -0700
committerDave Barach <openvpp@barachs.net>2018-08-07 15:52:07 +0000
commite25c9bf62e374bebcb89399470b7817c7f446b1b (patch)
tree28b20bc41aa863c1c5c73db08e8e5ef83b57327a
parent1d20f4748ccbf9d5ae3a7a0957d323d1b9f55d35 (diff)
api: compute msg table for private registrations
Change-Id: Ibaa236c09c2eeea72ee8a8cc603d407217b4af23 Signed-off-by: Florin Coras <fcoras@cisco.com>
-rw-r--r--src/vlibmemory/memory_api.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/vlibmemory/memory_api.c b/src/vlibmemory/memory_api.c
index 1da77c5b29b..1f5da4c786e 100644
--- a/src/vlibmemory/memory_api.c
+++ b/src/vlibmemory/memory_api.c
@@ -157,6 +157,7 @@ vl_api_memclnt_create_t_handler (vl_api_memclnt_create_t * mp)
int rv = 0;
void *oldheap;
api_main_t *am = &api_main;
+ u8 *msg_table;
/*
* This is tortured. Maintain a vlib-address-space private
@@ -209,6 +210,11 @@ vl_api_memclnt_create_t_handler (vl_api_memclnt_create_t * mp)
am->serialized_message_table_in_shmem =
vl_api_serialize_message_table (am, 0);
+ if (am->vlib_rp != am->vlib_primary_rp)
+ msg_table = vl_api_serialize_message_table (am, 0);
+ else
+ msg_table = am->serialized_message_table_in_shmem;
+
pthread_mutex_unlock (&svm->mutex);
svm_pop_heap (oldheap);
@@ -220,8 +226,7 @@ vl_api_memclnt_create_t_handler (vl_api_memclnt_create_t * mp)
am->shmem_hdr->application_restarts);
rp->context = mp->context;
rp->response = ntohl (rv);
- rp->message_table =
- pointer_to_uword (am->serialized_message_table_in_shmem);
+ rp->message_table = pointer_to_uword (msg_table);
vl_msg_api_send_shmem (q, (u8 *) & rp);
}