Module: sems
Branch: master
Commit: 291c9c5a3c62ad60a419fd57265ca3ef719e2542
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=291c9c5a3c62ad60a419fd57265ca3ef719e2542

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Fri Feb 18 15:21:12 2011 +0100

b/f: do not try DNS resolution if SRV target is an IP address.

---

 core/sip/resolver.cpp |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/core/sip/resolver.cpp b/core/sip/resolver.cpp
index e3443c7..c0ca24d 100644
--- a/core/sip/resolver.cpp
+++ b/core/sip/resolver.cpp
@@ -222,6 +222,13 @@ public:
        //TODO: find a solution for IPv6
        h->port = htons(e->port);
        ((sockaddr_in*)sa)->sin_port = h->port;
+
+       // check if name is an IP address
+       if(resolver::instance()->str2ip(e->target.c_str(),sa,IPv4) == 1) {
+           h->ip_n = -1; // flag end of IP list
+           return 0;
+       }
+
        return resolver::instance()->resolve_name(e->target.c_str(),h,sa,IPv4);
     }
 };

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to