diff options
author | 2016-11-28 05:36:24 -0800 | |
---|---|---|
committer | 2016-11-28 05:36:24 -0800 | |
commit | 38fb44f51d73f631df82830b4a09681fb2e41a3c (patch) | |
tree | ce731a25d7bd9977bb6aae5a342cc835cfc1d196 /plugins/snat-plugin/snat/snat.c | |
parent | 985f3d11fae7f93eb9a9e96d59b8e7a066819672 (diff) |
snat: fix coverity issues
Change-Id: Icb8239c02af8758a9e4bf299726a89677f53451d
Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'plugins/snat-plugin/snat/snat.c')
-rw-r--r-- | plugins/snat-plugin/snat/snat.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/snat-plugin/snat/snat.c b/plugins/snat-plugin/snat/snat.c index 70df44ea..02077c32 100644 --- a/plugins/snat-plugin/snat/snat.c +++ b/plugins/snat-plugin/snat/snat.c @@ -494,8 +494,10 @@ int snat_add_static_mapping(ip4_address_t l_addr, ip4_address_t e_addr, if (!clib_bihash_search_8_8 (&sm->user_hash, &kv, &value)) { user_index = value.value; - clib_bihash_search_8_8 (&sm->worker_by_in, &kv, &value); - tsm = vec_elt_at_index (sm->per_thread_data, value.value); + if (!clib_bihash_search_8_8 (&sm->worker_by_in, &kv, &value)) + tsm = vec_elt_at_index (sm->per_thread_data, value.value); + else + tsm = vec_elt_at_index (sm->per_thread_data, sm->num_workers); u = pool_elt_at_index (tsm->users, user_index); if (u->nstaticsessions) { |