lpm: fix allocation of an existing object
authorPavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Tue, 30 Jan 2018 18:51:54 +0000 (00:21 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 31 Jan 2018 23:35:06 +0000 (00:35 +0100)
commitfc29c712dd6758877bb10166d9a7866ee1fa6875
tree87208db5dd2a366f525d82aed8dbde4d1e1a7084
parent963898f0e316611df9dc2964d059b4e16835b95a
lpm: fix allocation of an existing object

Fix rte_lpm_create_*() functions to return NULL and set rte_errno to
EEXIST when lpm object name already exists.
This is the behavior described in the API documentation in the header
file.

Fixes: 134975073af3 ("lib: remove unnecessary pointer cast")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
lib/librte_lpm/rte_lpm.c