summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip_api.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-07-02 14:33:29 +0000
committerDave Barach <openvpp@barachs.net>2019-07-03 11:27:44 +0000
commitc2ac2357fb0ff598ca1cb650a5766a552e017833 (patch)
treef487a2b96ed9c9d8586c95df2b5472159832d630 /src/vnet/ip/ip_api.c
parenteaacce4753c33342a6512039fe4153b15b476fb3 (diff)
fib: allow route delete with no paths and multipath=0 to remove the
whole route Type: fix Fixes: 097fa66b Change-Id: I017ab5797670eb278c27c6e306cd8cadaacddf9d Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip_api.c')
-rw-r--r--src/vnet/ip/ip_api.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/vnet/ip/ip_api.c b/src/vnet/ip/ip_api.c
index 4d2f0704ca3..bcb53888621 100644
--- a/src/vnet/ip/ip_api.c
+++ b/src/vnet/ip/ip_api.c
@@ -667,13 +667,8 @@ ip_route_add_del_t_handler (vl_api_ip_route_add_del_t * mp, u32 * stats_index)
if (0 != rv)
goto out;
- if (0 == mp->route.n_paths)
- {
- rv = VNET_API_ERROR_NO_PATHS_IN_ROUTE;
- goto out;
- }
-
- vec_validate (rpaths, mp->route.n_paths - 1);
+ if (0 != mp->route.n_paths)
+ vec_validate (rpaths, mp->route.n_paths - 1);
for (ii = 0; ii < mp->route.n_paths; ii++)
{
@@ -690,9 +685,9 @@ ip_route_add_del_t_handler (vl_api_ip_route_add_del_t * mp, u32 * stats_index)
goto out;
}
- fib_api_route_add_del (mp->is_add,
- mp->is_multipath,
- fib_index, &pfx, entry_flags, rpaths);
+ rv = fib_api_route_add_del (mp->is_add,
+ mp->is_multipath,
+ fib_index, &pfx, entry_flags, rpaths);
if (mp->is_add && 0 == rv)
*stats_index = fib_table_entry_get_stats_index (fib_index, &pfx);