Module: kamailio
Branch: 4.4
Commit: 11971cbb21f9e7cface65251e7a991ffe8c9efc5
URL: https://github.com/kamailio/kamailio/commit/11971cbb21f9e7cface65251e7a991f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-10-10T12:10:33+02:00
core: proper code block when saving chosen naptr record
(cherry picked from commit a4b43f962a4493defb3fd608d1d2fad3ee58794a)
---
Modified: resolve.c
---
Diff: https://github.com/kamailio/kamailio/commit/11971cbb21f9e7cface65251e7a991f…
Patch: https://github.com/kamailio/kamailio/commit/11971cbb21f9e7cface65251e7a991f…
---
diff --git a/resolve.c b/resolve.c
index 0af1be3..3d57418 100644
--- a/resolve.c
+++ b/resolve.c
@@ -1335,7 +1335,7 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port,
-#ifdef USE_NAPTR
+#ifdef USE_NAPTR
/** iterates over a naptr rr list, returning each time a "good" naptr record
@@ -1343,7 +1343,7 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port,
* params:
* naptr_head - naptr rr list head
* tried - bitmap used to keep track of the already tried records
- * (no more then sizeof(tried)*8 valid records are
+ * (no more then sizeof(tried)*8 valid records are
* ever walked
* srv_name - if succesfull, it will be set to the selected record
* srv name (naptr repl.)
@@ -1351,10 +1351,10 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port,
* protocol
* returns 0 if no more records found or a pointer to the selected record
* and sets protocol and srv_name
- * WARNING: when calling first time make sure you run first
+ * WARNING: when calling first time make sure you run first
* naptr_iterate_init(&tried)
*/
-struct rdata* naptr_sip_iterate(struct rdata* naptr_head,
+struct rdata* naptr_sip_iterate(struct rdata* naptr_head,
naptr_bmp_t* tried,
str* srv_name, char* proto)
{
@@ -1373,7 +1373,7 @@ struct rdata* naptr_sip_iterate(struct rdata* naptr_head,
saved_proto=0;
i=0;
for(l=naptr_head; l && (i<MAX_NAPTR_RRS); l=l->next){
- if (l->type!=T_NAPTR) continue;
+ if (l->type!=T_NAPTR) continue;
naptr=(struct naptr_rdata*) l->rdata;
if (naptr==0){
LM_CRIT("null rdata\n");
@@ -1391,17 +1391,18 @@ struct rdata* naptr_sip_iterate(struct rdata* naptr_head,
#endif
if ((naptr_proto_supported(naptr_proto))){
if (naptr_choose(&naptr_saved, &saved_proto,
- naptr, naptr_proto))
+ naptr, naptr_proto)) {
idx=i;
l_saved=l;
}
+ }
i++;
}
if (naptr_saved){
/* found something */
#ifdef NAPTR_DBG
LM_DBG("choosed NAPTR rr %.*s, proto %d tried: 0x%x\n",
- naptr_saved->repl_len,
+ naptr_saved->repl_len,
naptr_saved->repl, (int)saved_proto, *tried);
#endif
*tried|=1<<idx;