Module: kamailio
Branch: master
Commit: 37f06f031c4ce93bcf4494744282c17f7a2d157c
URL:
https://github.com/kamailio/kamailio/commit/37f06f031c4ce93bcf4494744282c17…
Author: Julien Chavanton <jchavanton(a)gmail.com>
Committer: GitHub <noreply(a)github.com>
Date: 2020-11-05T07:09:38-08:00
core: DNS stop resolving NAPTR for IP addresses (#2541)
---
Modified: src/core/dns_cache.c
---
Diff:
https://github.com/kamailio/kamailio/commit/37f06f031c4ce93bcf4494744282c17…
Patch:
https://github.com/kamailio/kamailio/commit/37f06f031c4ce93bcf4494744282c17…
---
diff --git a/src/core/dns_cache.c b/src/core/dns_cache.c
index 926dbfef76..9a4b90fba3 100644
--- a/src/core/dns_cache.c
+++ b/src/core/dns_cache.c
@@ -3292,6 +3292,9 @@ inline static int dns_naptr_sip_resolve(struct dns_srv_handle* h,
str* name,
}
try_lookup_naptr = 1;
}
+ /* check if it's an ip address, dns_srv_sip_resolve will return the right failure
*/
+ if (str2ip(name) || str2ip6(name))
+ goto naptr_not_found;
/* do naptr lookup */
if ((e=dns_get_entry(name, T_NAPTR))==0)
goto naptr_not_found;