/** Find cached record by name */
uword *cache_entry_by_name;
clib_spinlock_t cache_lock;
+ int cache_lock_tag;
/** enable / disable flag */
int is_enabled;
_(UNIMPLEMENTED, "Unimplemented") \
_(PROCESSED, "DNS request pkts processed") \
_(IP_OPTIONS, "DNS pkts with ip options (dropped)") \
-_(BAD_REQUEST, "DNS pkts with serious discrepanices (dropped)") \
+_(BAD_REQUEST, "DNS pkts with serious discrepancies (dropped)") \
_(TOO_MANY_REQUESTS, "DNS pkts asking too many questions") \
_(RESOLUTION_REQUIRED, "DNS pkts pending upstream name resolution")
format_function_t format_dns_reply;
static inline void
-dns_cache_lock (dns_main_t * dm)
+dns_cache_lock (dns_main_t * dm, int tag)
{
if (dm->cache_lock)
{
+ ASSERT (tag);
+ ASSERT (dm->cache_lock_tag == 0);
clib_spinlock_lock (&dm->cache_lock);
+ dm->cache_lock_tag = tag;
}
}
{
if (dm->cache_lock)
{
+ ASSERT (dm->cache_lock_tag);
+ dm->cache_lock_tag = 0;
clib_spinlock_unlock (&dm->cache_lock);
}
}