Module: kamailio
Branch: master
Commit: d8a35b3b6c837b36779e232b65fce61c3aa93387
URL: 
https://github.com/kamailio/kamailio/commit/d8a35b3b6c837b36779e232b65fce61c3aa93387

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2023-09-26T20:20:56+02:00

core: dns cache - warn messages on safety checks for items

---

Modified: src/core/dns_cache.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/d8a35b3b6c837b36779e232b65fce61c3aa93387.diff
Patch: 
https://github.com/kamailio/kamailio/commit/d8a35b3b6c837b36779e232b65fce61c3aa93387.patch

---

diff --git a/src/core/dns_cache.c b/src/core/dns_cache.c
index 58c48b33dae..4ad478ba88d 100644
--- a/src/core/dns_cache.c
+++ b/src/core/dns_cache.c
@@ -1690,6 +1690,9 @@ inline static struct dns_hash_entry *dns_get_related(
        l = e;
        LM_DBG("(%p (%.*s, %d), %d, *%p) (%d)\n", e, e->name_len, e->name, 
e->type,
                        type, *records, cname_chain_len);
+       if(l->prev != NULL || l->next != NULL) {
+               LM_WARN("record not alone: %p - type: %d\n", l, (int)l->type);
+       }
        clist_init(l, next, prev);
        if(type == e->type) {
                ret = e;
@@ -2034,6 +2037,9 @@ inline static struct dns_hash_entry 
*dns_cache_do_request(str *name, int type)
        }
 #endif
 end:
+       if(e != NULL && e->prev == NULL && e->next == NULL) {
+               LM_WARN("record not linked: %p - type: %d\n", e, (int)e->type);
+       }
        return e;
 }
 

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to