Module: sip-router
Branch: master
Commit: b834cde74f8a4b41ec24ceb8332adff8bb3922bb
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b834cde…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Apr 30 21:46:55 2014 +0200
core: compute the len for dns srv name
- fixes dns srv for cache, reported by Rob Eijgenraam, FS#426
---
dns_cache.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/dns_cache.c b/dns_cache.c
index 7465c83..029b445 100644
--- a/dns_cache.c
+++ b/dns_cache.c
@@ -2656,7 +2656,6 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short*
port,
struct hostent* he;
struct ip_addr* ip;
static char tmp[MAX_DNS_NAME]; /* tmp. buff. for SRV lookups */
- int len;
str srv_name;
char srv_proto;
@@ -2664,7 +2663,6 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short*
port,
/* not init or off => use normal, non-cached version */
return _sip_resolvehost(name, port, proto);
}
- len=0;
if (proto){ /* makes sure we have a protocol set*/
if (*proto==0)
*proto=srv_proto=PROTO_UDP; /* default */
@@ -2708,7 +2706,7 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short*
port,
}
srv_name.s=tmp;
- srv_name.len=len;
+ srv_name.len=strlen(tmp);
if ((he=dns_srv_get_he(&srv_name, port, dns_flags))!=0)
return he;
}