All callers to delete_random_entry() are already holding the lock to
the DNS cache. Thanks to Rain for the report.
Type: fix
Change-Id: Id051427016f9b7444b812019ccc0f5085fd3e469
Signed-off-by: Benoît Ganne <[email protected]>
return VNET_API_ERROR_UNSPECIFIED;
#endif
- dns_cache_lock (dm, 3);
+ CLIB_SPINLOCK_ASSERT_LOCKED (&dm->cache_lock);
+
limit = pool_elts (dm->entries);
start_index = random_u32 (&dm->random_seed) % limit;
&& ((ep->flags & DNS_CACHE_ENTRY_FLAG_STATIC) == 0))
{
rv = vnet_dns_delete_entry_by_index_nolock (dm, victim_index);
- dns_cache_unlock (dm);
return rv;
}
}
}
- dns_cache_unlock (dm);
clib_warning ("Couldn't find an entry to delete?");
return VNET_API_ERROR_UNSPECIFIED;