summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-02-18 15:23:29 +0000
committerNeale Ranns <nranns@cisco.com>2020-02-20 08:35:45 +0000
commita434955b334dcf4fdf79490263b45c75641c6424 (patch)
tree7d5024d9d08911531ef044ef5a8152e1540c0214
parentac267dd41be0265b23f2c1666e819994518e577a (diff)
fib: fib path realloc during midchain stack
Type: fix Change-Id: I0677f46dfa22c8abab7f311230a09ef1cd8ac335 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 02d5a67d39cbb8f1865227afdc79533578067b8d)
-rw-r--r--src/vnet/fib/fib_path.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/vnet/fib/fib_path.c b/src/vnet/fib/fib_path.c
index f8950fa5a49..6b1e8339786 100644
--- a/src/vnet/fib/fib_path.c
+++ b/src/vnet/fib/fib_path.c
@@ -645,14 +645,16 @@ fib_path_last_lock_gone (fib_node_t *node)
ASSERT(0);
}
-static void
+static fib_path_t*
fib_path_attached_next_hop_get_adj (fib_path_t *path,
vnet_link_t link,
dpo_id_t *dpo)
{
+ fib_node_index_t fib_path_index;
fib_protocol_t nh_proto;
adj_index_t ai;
+ fib_path_index = fib_path_get_index(path);
nh_proto = dpo_proto_to_fib(path->fp_nh_proto);
if (vnet_sw_interface_is_p2p(vnet_get_main(),
@@ -676,6 +678,8 @@ fib_path_attached_next_hop_get_adj (fib_path_t *path,
dpo_set(dpo, DPO_ADJACENCY, vnet_link_to_dpo_proto(link), ai);
adj_unlock(ai);
+
+ return (fib_path_get(fib_path_index));
}
static void
@@ -685,9 +689,9 @@ fib_path_attached_next_hop_set (fib_path_t *path)
* resolve directly via the adjacency discribed by the
* interface and next-hop
*/
- fib_path_attached_next_hop_get_adj(path,
- dpo_proto_to_link(path->fp_nh_proto),
- &path->fp_dpo);
+ path = fib_path_attached_next_hop_get_adj(path,
+ dpo_proto_to_link(path->fp_nh_proto),
+ &path->fp_dpo);
ASSERT(dpo_is_adj(&path->fp_dpo));
@@ -1111,7 +1115,7 @@ FIXME comment
vnet_get_main(),
path->attached_next_hop.fp_interface);
- fib_path_attached_next_hop_get_adj(
+ path = fib_path_attached_next_hop_get_adj(
path,
dpo_proto_to_link(path->fp_nh_proto),
&path->fp_dpo);
@@ -2447,10 +2451,10 @@ fib_path_contribute_forwarding (fib_node_index_t path_index,
case FIB_FORW_CHAIN_TYPE_NSH:
case FIB_FORW_CHAIN_TYPE_MCAST_IP4:
case FIB_FORW_CHAIN_TYPE_MCAST_IP6:
- fib_path_attached_next_hop_get_adj(
- path,
- fib_forw_chain_type_to_link_type(fct),
- dpo);
+ path = fib_path_attached_next_hop_get_adj(
+ path,
+ fib_forw_chain_type_to_link_type(fct),
+ dpo);
break;
case FIB_FORW_CHAIN_TYPE_BIER:
break;