diff options
author | Neale Ranns <nranns@cisco.com> | 2016-12-07 15:38:14 +0000 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-12-07 17:17:30 +0000 |
commit | 19c68d2a02770189d32ead3ff964efc073db630a (patch) | |
tree | 3a985d73e731c776b76dc72c28c5d38865c9b848 /vnet/vnet/ip/ip6_neighbor.c | |
parent | 9677a944d5188f10188657bf627301b239fe1da7 (diff) |
Prevent re-entrant walks on an adjacency.
The re-entrant walks were caused when the walk from an IP adj updated a fib_netry with an MPLS adj which in turn triggers a walk of the IP adj. Re-entrant walks do unnecessary work.
also fixed a walk merge issue where the encountered walk should only be checked for equivalence woth the most recent alk, not any in the list. Otherwise an UO,DOWN,UP beceoms (2*)UP,DOWN
Change-Id: Ib8b27f055dc6c1366d33740276d1c26cd314220a
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'vnet/vnet/ip/ip6_neighbor.c')
-rw-r--r-- | vnet/vnet/ip/ip6_neighbor.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/vnet/vnet/ip/ip6_neighbor.c b/vnet/vnet/ip/ip6_neighbor.c index 92417a44025..15b3f764622 100644 --- a/vnet/vnet/ip/ip6_neighbor.c +++ b/vnet/vnet/ip/ip6_neighbor.c @@ -402,13 +402,15 @@ ip6_nd_mk_complete (adj_index_t ai, ip6_neighbor_t * nbr) } static void -ip6_nd_mk_incomplete (adj_index_t ai, ip6_neighbor_t * nbr) +ip6_nd_mk_incomplete (adj_index_t ai) { + ip_adjacency_t *adj = adj_get(ai); + adj_nbr_update_rewrite ( ai, ADJ_NBR_REWRITE_FLAG_INCOMPLETE, ethernet_build_rewrite (vnet_get_main (), - nbr->key.sw_if_index, + adj->rewrite_header.sw_if_index, adj_get_link_type(ai), VNET_REWRITE_FOR_SW_INTERFACE_ADDRESS_BROADCAST)); } @@ -452,9 +454,7 @@ ip6_nd_mk_complete_walk (adj_index_t ai, void *ctx) static adj_walk_rc_t ip6_nd_mk_incomplete_walk (adj_index_t ai, void *ctx) { - ip6_neighbor_t *nbr = ctx; - - ip6_nd_mk_incomplete (ai, nbr); + ip6_nd_mk_incomplete (ai); return (ADJ_WALK_RC_CONTINUE); } @@ -683,13 +683,13 @@ vnet_unset_ip6_ethernet_neighbor (vlib_main_t * vm, } n = pool_elt_at_index (nm->neighbor_pool, p[0]); + mhash_unset (&nm->neighbor_index_by_key, &n->key, 0); adj_nbr_walk_nh6 (sw_if_index, &n->key.ip6_address, ip6_nd_mk_incomplete_walk, - n); + NULL); - mhash_unset (&nm->neighbor_index_by_key, &n->key, 0); fib_table_entry_delete_index (n->fib_entry_index, FIB_SOURCE_ADJ); pool_put (nm->neighbor_pool, n); |