Skip to content

Commit

Permalink
core: dns cache - warn messages on safety checks for items
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Sep 26, 2023
1 parent 6f332ba commit d8a35b3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/dns_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

This comment has been minimized.

Copy link
@gaaf

gaaf May 27, 2024

Contributor

Care to explain why this is wrong? Some DNS records that are fully in spec and have functioned for years without any problem now trigger filling the logs with these warnings.
Also, actually logging which record(s) are causing the issue and what would be needed to be done to fix them would be helpful, the hex address and message doesn't provide any useful info for the admin.

2024-05-27T10:01:04.263247+02:00 pc1 proxy1[335503]: WARNING: <core> [core/dns_cache.c:1700]: dns_get_related(): record not alone: 0x7f714ee28250 - type: 33
2024-05-27T10:01:04.269368+02:00 pc1 proxy1[335503]: WARNING: <core> [core/dns_cache.c:1700]: dns_get_related(): record not alone: 0x7f714ee28380 - type: 1
}
clist_init(l, next, prev);
if(type == e->type) {
ret = e;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit d8a35b3

Please sign in to comment.