diff options
author | Ole Troan <ot@cisco.com> | 2019-04-10 09:44:23 +0200 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2019-04-10 13:06:45 +0000 |
commit | 2e1c8967faf4e9f7b45471df02e4e5b07fbb520a (patch) | |
tree | 172579d8d04927851d1781262bd2483fa9bf8643 /src/plugins/nat | |
parent | 13464f323a8bbd530bd85256de1c033781e098a7 (diff) |
API: Fix shared memory only action handlers.
Some API action handlers called vl_msg_ai_send_shmem()
directly. That breaks Unix domain socket API transport.
A couple (bond / vhost) also tried to send a sw_interface_event
directly, but did not send the message to all that had
registred interest. That scheme never worked correctly.
Refactored and improved the interface event code.
Change-Id: Idb90edfd8703c6ae593b36b4eeb4d3ed7da5c808
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/plugins/nat')
-rw-r--r-- | src/plugins/nat/nat_api.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/nat/nat_api.c b/src/plugins/nat/nat_api.c index 516b27fb6f5..21b2cd44880 100644 --- a/src/plugins/nat/nat_api.c +++ b/src/plugins/nat/nat_api.c @@ -3267,7 +3267,7 @@ static void *vl_api_nat66_add_del_static_mapping_t_print typedef struct nat66_api_walk_ctx_t_ { - svm_queue_t *q; + vl_api_registration_t *rp; u32 context; } nat66_api_walk_ctx_t; @@ -3285,7 +3285,7 @@ nat66_api_interface_walk (snat_interface_t * i, void *arg) rmp->is_inside = nat_interface_is_inside (i); rmp->context = ctx->context; - vl_msg_api_send_shmem (ctx->q, (u8 *) & rmp); + vl_api_send_msg (ctx->rp, (u8 *) rmp); return 0; } @@ -3293,14 +3293,14 @@ nat66_api_interface_walk (snat_interface_t * i, void *arg) static void vl_api_nat66_interface_dump_t_handler (vl_api_nat66_interface_dump_t * mp) { - svm_queue_t *q; + vl_api_registration_t *rp; - q = vl_api_client_index_to_input_queue (mp->client_index); - if (q == 0) + rp = vl_api_client_index_to_registration (mp->client_index); + if (rp == 0) return; nat66_api_walk_ctx_t ctx = { - .q = q, + .rp = rp, .context = mp->context, }; @@ -3345,7 +3345,7 @@ nat66_api_static_mapping_walk (nat66_static_mapping_t * m, void *arg) rmp->total_pkts = clib_host_to_net_u64 (vc.packets); rmp->context = ctx->context; - vl_msg_api_send_shmem (ctx->q, (u8 *) & rmp); + vl_api_send_msg (ctx->rp, (u8 *) rmp); return 0; } @@ -3354,14 +3354,14 @@ static void vl_api_nat66_static_mapping_dump_t_handler (vl_api_nat66_static_mapping_dump_t * mp) { - svm_queue_t *q; + vl_api_registration_t *rp; - q = vl_api_client_index_to_input_queue (mp->client_index); - if (q == 0) + rp = vl_api_client_index_to_registration (mp->client_index); + if (rp == 0) return; nat66_api_walk_ctx_t ctx = { - .q = q, + .rp = rp, .context = mp->context, }; |