Module: kamailio
Branch: 5.4
Commit: a97206031ff0c28f791a5789f6dfc37707a4b59d
URL: 
https://github.com/kamailio/kamailio/commit/a97206031ff0c28f791a5789f6dfc37707a4b59d

Author: Julien Chavanton <[email protected]>
Committer: Julien Chavanton <[email protected]>
Date: 2020-11-05T07:14:44-08:00

core: DNS stop resolving NAPTR for IP addresses (#2541)


(cherry picked from commit 37f06f031c4ce93bcf4494744282c17f7a2d157c)

---

Modified: src/core/dns_cache.c

---

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

---

diff --git a/src/core/dns_cache.c b/src/core/dns_cache.c
index 923c65049d..e383786de2 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;


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to