From dbf19ca7f9b93a843503f9204afd0815f3ef8332 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Tue, 15 Mar 2016 10:21:54 +0100 Subject: Make adjacencies shareable Change-Id: I620871ca715b751d2e487f37341b7118797c9176 Signed-off-by: Damjan Marion --- vnet/vnet/ip/ip6_forward.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vnet/vnet/ip/ip6_forward.c') 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) -- cgit 1.2.3-korg