Module: kamailio
Branch: master
Commit: b2ac541e934bba5758c7af4e59091da24bc96ca6
URL: https://github.com/kamailio/kamailio/commit/b2ac541e934bba5758c7af4e59091da…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-06-30T08:19:55+02:00
core: formatted the list of dns error messages
---
Modified: src/core/dns_cache.c
---
Diff: https://github.com/kamailio/kamailio/commit/b2ac541e934bba5758c7af4e59091da……
[View More]Patch: https://github.com/kamailio/kamailio/commit/b2ac541e934bba5758c7af4e59091da…
---
diff --git a/src/core/dns_cache.c b/src/core/dns_cache.c
index fbc5e83f27c..6c5f8c38e1b 100644
--- a/src/core/dns_cache.c
+++ b/src/core/dns_cache.c
@@ -120,14 +120,24 @@ static atomic_t *dns_servers_up = NULL;
#endif
-static const char *dns_str_errors[] = {"no error",
- "no more records", /* not an error, but and end condition */
- "unknown error", "internal error", "bad SRV entry",
- "unresolvable SRV request", "bad A or AAAA entry",
- "unresolvable A or AAAA request", "invalid ip in A or AAAA record",
- "blocklisted ip", "name too long ", /* try again with a shorter name */
- "ip AF mismatch", /* address family mismatch */
- "unresolvable NAPTR request", "bug - critical error"};
+/* clang-format off */
+static const char *dns_str_errors[] = {
+ "no error",
+ "no more records", /* not an error, but and end condition */
+ "unknown error",
+ "internal error",
+ "bad SRV entry",
+ "unresolvable SRV request",
+ "bad A or AAAA entry",
+ "unresolvable A or AAAA request",
+ "invalid ip in A or AAAA record",
+ "blocklisted ip",
+ "name too long ", /* try again with a shorter name */
+ "ip AF mismatch", /* address family mismatch */
+ "unresolvable NAPTR request",
+ "bug - critical error"
+};
+/* clang-format on */
void dns_set_local_ttl(int ttl)
[View Less]
Module: kamailio
Branch: master
Commit: 81e9c4f965dcedccdc73f88c6b8f0c2ff09598c8
URL: https://github.com/kamailio/kamailio/commit/81e9c4f965dcedccdc73f88c6b8f0c2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-06-27T13:41:29+02:00
core: log file and line for dns hash remove entry with high refcnt
---
Modified: src/core/dns_cache.c
---
Diff: https://github.com/kamailio/kamailio/commit/…
[View More]81e9c4f965dcedccdc73f88c6b8f0c2…
Patch: https://github.com/kamailio/kamailio/commit/81e9c4f965dcedccdc73f88c6b8f0c2…
---
diff --git a/src/core/dns_cache.c b/src/core/dns_cache.c
index 9f6e47781f2..fbc5e83f27c 100644
--- a/src/core/dns_cache.c
+++ b/src/core/dns_cache.c
@@ -484,18 +484,24 @@ int init_dns_cache_stats(int iproc_num)
/* must be called with the DNS_LOCK hold
* removes an entry from the hash, dec. its refcnt and if not referenced
* anymore deletes it */
-inline static void _dns_hash_remove(struct dns_hash_entry *e)
+inline static void _dns_hash_remove_entry(
+ struct dns_hash_entry *e, char *fpath, unsigned int line)
{
clist_rm(e, next, prev);
e->next = e->prev = 0;
- debug_lu_lst("_dns_hash_remove: pre rm:", &e->last_used_lst);
+ debug_lu_lst("dns hash remove: pre rm:", &e->last_used_lst);
clist_rm(&e->last_used_lst, next, prev);
- debug_lu_lst("_dns_hash_remove: post rm:", &e->last_used_lst);
+ debug_lu_lst("dns hash remove: post rm:", &e->last_used_lst);
e->last_used_lst.next = e->last_used_lst.prev = 0;
*dns_cache_mem_used -= e->total_size;
+ if(atomic_get_int(&e->refcnt) > 1) {
+ LM_INFO("item %p with high refcnt %d (%s:%u)\n", e,
+ atomic_get_int(&e->refcnt), fpath, line);
+ }
dns_hash_put(e);
}
+#define _dns_hash_remove(e) _dns_hash_remove_entry(e, __FILE__, __LINE__)
/* non locking version (the dns hash must _be_ locked externally)
* returns 0 when not found, or the entry on success (an entry with a
[View Less]