aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-09-07 01:48:54 -0700
committerDamjan Marion <dmarion@me.com>2018-09-07 11:16:14 +0000
commit3b93be5d76cbcb5dc3d3aee5c72a797014a346f9 (patch)
tree6c8706c9b518ee09ccdee790296e1759c5f78c76 /src
parentc84cbad785fa11c1dba92b8e87ad234d779d1cbd (diff)
IP route update fix when multipath and drop set
Change-Id: I9cec7486cb6e3c5261d74d2b15a4d19469285a30 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/ip/ip_api.c34
-rw-r--r--src/vpp/api/custom_dump.c20
2 files changed, 31 insertions, 23 deletions
diff --git a/src/vnet/ip/ip_api.c b/src/vnet/ip/ip_api.c
index 7217f9d101a..31b7e40a880 100644
--- a/src/vnet/ip/ip_api.c
+++ b/src/vnet/ip/ip_api.c
@@ -839,26 +839,6 @@ add_del_route_t_handler (u8 is_multipath,
path.frp_flags = path_flags;
- if (is_multipath)
- {
- stats_dslock_with_hint (1 /* release hint */ , 10 /* tag */ );
-
-
- vec_add1 (paths, path);
-
- if (is_add)
- fib_table_entry_path_add2 (fib_index,
- prefix,
- FIB_SOURCE_API, entry_flags, paths);
- else
- fib_table_entry_path_remove2 (fib_index,
- prefix, FIB_SOURCE_API, paths);
-
- vec_free (paths);
- stats_dsunlock ();
- return 0;
- }
-
stats_dslock_with_hint (1 /* release hint */ , 2 /* tag */ );
if (is_drop || is_local || is_classify || is_unreach || is_prohibit)
@@ -914,6 +894,20 @@ add_del_route_t_handler (u8 is_multipath,
fib_table_entry_special_remove (fib_index, prefix, FIB_SOURCE_API);
}
}
+ else if (is_multipath)
+ {
+ vec_add1 (paths, path);
+
+ if (is_add)
+ fib_table_entry_path_add2 (fib_index,
+ prefix,
+ FIB_SOURCE_API, entry_flags, paths);
+ else
+ fib_table_entry_path_remove2 (fib_index,
+ prefix, FIB_SOURCE_API, paths);
+
+ vec_free (paths);
+ }
else
{
if (is_add)
diff --git a/src/vpp/api/custom_dump.c b/src/vpp/api/custom_dump.c
index 2a8cd78b0fc..57268a9692c 100644
--- a/src/vpp/api/custom_dump.c
+++ b/src/vpp/api/custom_dump.c
@@ -758,15 +758,28 @@ static void *vl_api_ip_add_del_route_t_print
if (mp->is_multipath)
s = format (s, "multipath ");
- if (mp->is_multipath)
- s = format (s, "multipath ");
-
if (mp->next_hop_table_id)
s = format (s, "lookup-in-vrf %d ", ntohl (mp->next_hop_table_id));
FINISH;
}
+static void *vl_api_ip_table_add_del_t_print
+ (vl_api_ip_table_add_del_t * mp, void *handle)
+{
+ u8 *s;
+
+ s = format (0, "SCRIPT: ip_table_add_del ");
+ if (!mp->is_add)
+ s = format (s, "del ");
+ if (mp->is_ipv6)
+ s = format (s, "ip6 ");
+ if (mp->table_id != 0)
+ s = format (s, "vrf %d ", ntohl (mp->table_id));
+
+ FINISH;
+}
+
static void *vl_api_proxy_arp_add_del_t_print
(vl_api_proxy_arp_add_del_t * mp, void *handle)
{
@@ -3560,6 +3573,7 @@ _(TAP_CREATE_V2, tap_create_v2) \
_(TAP_DELETE_V2, tap_delete_v2) \
_(SW_INTERFACE_TAP_V2_DUMP, sw_interface_tap_v2_dump) \
_(IP_ADD_DEL_ROUTE, ip_add_del_route) \
+_(IP_TABLE_ADD_DEL, ip_table_add_del) \
_(PROXY_ARP_ADD_DEL, proxy_arp_add_del) \
_(PROXY_ARP_INTFC_ENABLE_DISABLE, proxy_arp_intfc_enable_disable) \
_(MPLS_TUNNEL_ADD_DEL, mpls_tunnel_add_del) \