Change-Id: I439aac05638fd40e314bec8756e42a32c436321c
Signed-off-by: John Lo <loj@cisco.com>
old_adj_index = fib->old_hash_values[0];
/* Avoid spurious reference count increments */
- if (old_adj_index == adj_index && !(a->flags & IP4_ROUTE_FLAG_KEEP_OLD_ADJACENCY))
+ if (old_adj_index == adj_index
+ && adj_index != ~0
+ && !(a->flags & IP4_ROUTE_FLAG_KEEP_OLD_ADJACENCY))
{
ip_adjacency_t * adj = ip_get_adjacency (lm, adj_index);
if (adj->share_count > 0)
}
/* Avoid spurious reference count increments */
- if (old_adj_index == adj_index && !(a->flags & IP6_ROUTE_FLAG_KEEP_OLD_ADJACENCY))
+ if (old_adj_index == adj_index
+ && adj_index != ~0
+ && !(a->flags & IP6_ROUTE_FLAG_KEEP_OLD_ADJACENCY))
{
ip_adjacency_t * adj = ip_get_adjacency (lm, adj_index);
if (adj->share_count > 0)