summaryrefslogtreecommitdiffstats
path: root/vnet/vnet/ip/ip6_forward.c
diff options
context:
space:
mode:
Diffstat (limited to 'vnet/vnet/ip/ip6_forward.c')
-rw-r--r--vnet/vnet/ip/ip6_forward.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/vnet/vnet/ip/ip6_forward.c b/vnet/vnet/ip/ip6_forward.c
index fd6874d4def..1d0e21e528c 100644
--- a/vnet/vnet/ip/ip6_forward.c
+++ b/vnet/vnet/ip/ip6_forward.c
@@ -265,6 +265,14 @@ void ip6_add_del_route (ip6_main_t * im, ip6_add_del_route_args_t * a)
BV(clib_bihash_add_del) (&im->ip6_lookup_table, &kv, 1 /* is_add */);
}
+ /* Avoid spurious reference count increments */
+ if (old_adj_index == adj_index)
+ {
+ ip_adjacency_t * adj = ip_get_adjacency (lm, adj_index);
+ if (adj->share_count > 0)
+ adj->share_count --;
+ }
+
/* Delete old adjacency index if present and changed. */
{
if (! (a->flags & IP6_ROUTE_FLAG_KEEP_OLD_ADJACENCY)