|
@@ -151,8 +151,7 @@ static on_resolv_reinit on_resolv_reinit_cb = NULL;
|
|
int register_resolv_reinit_cb(on_resolv_reinit cb)
|
|
int register_resolv_reinit_cb(on_resolv_reinit cb)
|
|
{
|
|
{
|
|
if (on_resolv_reinit_cb) {
|
|
if (on_resolv_reinit_cb) {
|
|
- LOG(L_ERR, "ERROR: register_resolv_reinit_cb(): "
|
|
|
|
- "callback function has been already registered\n");
|
|
|
|
|
|
+ LM_ERR("callback function has been already registered\n");
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
on_resolv_reinit_cb = cb;
|
|
on_resolv_reinit_cb = cb;
|
|
@@ -201,8 +200,7 @@ static int _resolv_init(void)
|
|
_res.options&=~(RES_DEFNAMES|RES_DNSRCH);
|
|
_res.options&=~(RES_DEFNAMES|RES_DNSRCH);
|
|
#else
|
|
#else
|
|
#warning "no resolv timeout support"
|
|
#warning "no resolv timeout support"
|
|
- LOG(L_WARN, "WARNING: _resolv_init: no resolv options support - resolv"
|
|
|
|
- " options will be ignored\n");
|
|
|
|
|
|
+ LM_WARN("no resolv options support - resolv options will be ignored\n");
|
|
#endif
|
|
#endif
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -232,8 +230,7 @@ void resolv_reinit(str *gname, str *name)
|
|
#ifdef DNS_WATCHDOG_SUPPORT
|
|
#ifdef DNS_WATCHDOG_SUPPORT
|
|
if (on_resolv_reinit_cb) on_resolv_reinit_cb(name);
|
|
if (on_resolv_reinit_cb) on_resolv_reinit_cb(name);
|
|
#endif
|
|
#endif
|
|
- LOG(L_DBG, "DEBUG: resolv_reinit(): "
|
|
|
|
- "DNS resolver has been reinitialized\n");
|
|
|
|
|
|
+ LM_DBG("DNS resolver has been reinitialized\n");
|
|
}
|
|
}
|
|
|
|
|
|
/* fixup function for dns_reinit variable
|
|
/* fixup function for dns_reinit variable
|
|
@@ -260,8 +257,7 @@ void reinit_proto_prefs(str *gname, str *name)
|
|
int dns_try_ipv6_fixup(void *handle, str *gname, str *name, void **val)
|
|
int dns_try_ipv6_fixup(void *handle, str *gname, str *name, void **val)
|
|
{
|
|
{
|
|
if ((int)(long)(*val) && !(socket_types & SOCKET_T_IPV6)) {
|
|
if ((int)(long)(*val) && !(socket_types & SOCKET_T_IPV6)) {
|
|
- LOG(L_ERR, "ERROR: dns_try_ipv6_fixup(): "
|
|
|
|
- "SER does not listen on any ipv6 interface, "
|
|
|
|
|
|
+ LM_ERR("SER does not listen on any ipv6 interface, "
|
|
"there is no point in resolving ipv6 addresses\n");
|
|
"there is no point in resolving ipv6 addresses\n");
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
@@ -341,7 +337,7 @@ struct srv_rdata* dns_srv_parser( unsigned char* msg, unsigned char* end,
|
|
/* alloc enought space for the struct + null terminated name */
|
|
/* alloc enought space for the struct + null terminated name */
|
|
srv=local_malloc(sizeof(struct srv_rdata)-1+len+1);
|
|
srv=local_malloc(sizeof(struct srv_rdata)-1+len+1);
|
|
if (srv==0){
|
|
if (srv==0){
|
|
- LOG(L_ERR, "ERROR: dns_srv_parser: out of memory\n");
|
|
|
|
|
|
+ LM_ERR("out of memory\n");
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
srv->priority=ntohs(priority);
|
|
srv->priority=ntohs(priority);
|
|
@@ -427,7 +423,7 @@ struct naptr_rdata* dns_naptr_parser( unsigned char* msg, unsigned char* end,
|
|
naptr=local_malloc(sizeof(struct naptr_rdata)+flags_len+services_len+
|
|
naptr=local_malloc(sizeof(struct naptr_rdata)+flags_len+services_len+
|
|
regexp_len+len+1-1);
|
|
regexp_len+len+1-1);
|
|
if (naptr == 0){
|
|
if (naptr == 0){
|
|
- LOG(L_ERR, "ERROR: dns_naptr_parser: out of memory\n");
|
|
|
|
|
|
+ LM_ERR("out of memory\n");
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
naptr->order=ntohs(order);
|
|
naptr->order=ntohs(order);
|
|
@@ -472,7 +468,7 @@ struct cname_rdata* dns_cname_parser( unsigned char* msg, unsigned char* end,
|
|
/* alloc sizeof struct + space for the null terminated name */
|
|
/* alloc sizeof struct + space for the null terminated name */
|
|
cname=local_malloc(sizeof(struct cname_rdata)-1+len+1);
|
|
cname=local_malloc(sizeof(struct cname_rdata)-1+len+1);
|
|
if(cname==0){
|
|
if(cname==0){
|
|
- LOG(L_ERR, "ERROR: dns_cname_parser: out of memory\n");
|
|
|
|
|
|
+ LM_ERR("out of memory\n");
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
cname->name_len=len;
|
|
cname->name_len=len;
|
|
@@ -496,7 +492,7 @@ struct a_rdata* dns_a_parser(unsigned char* rdata, unsigned char* eor)
|
|
if (rdata+4>eor) goto error;
|
|
if (rdata+4>eor) goto error;
|
|
a=(struct a_rdata*)local_malloc(sizeof(struct a_rdata));
|
|
a=(struct a_rdata*)local_malloc(sizeof(struct a_rdata));
|
|
if (a==0){
|
|
if (a==0){
|
|
- LOG(L_ERR, "ERROR: dns_a_parser: out of memory\n");
|
|
|
|
|
|
+ LM_ERR("out of memory\n");
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
memcpy(a->ip, rdata, 4);
|
|
memcpy(a->ip, rdata, 4);
|
|
@@ -516,7 +512,7 @@ struct aaaa_rdata* dns_aaaa_parser(unsigned char* rdata, unsigned char* eor)
|
|
if (rdata+16>eor) goto error;
|
|
if (rdata+16>eor) goto error;
|
|
aaaa=(struct aaaa_rdata*)local_malloc(sizeof(struct aaaa_rdata));
|
|
aaaa=(struct aaaa_rdata*)local_malloc(sizeof(struct aaaa_rdata));
|
|
if (aaaa==0){
|
|
if (aaaa==0){
|
|
- LOG(L_ERR, "ERROR: dns_aaaa_parser: out of memory\n");
|
|
|
|
|
|
+ LM_ERR("out of memory\n");
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
memcpy(aaaa->ip6, rdata, 16);
|
|
memcpy(aaaa->ip6, rdata, 16);
|
|
@@ -567,7 +563,7 @@ static struct txt_rdata* dns_txt_parser(unsigned char* msg, unsigned char* end,
|
|
txt=local_malloc(sizeof(struct txt_rdata) +(n-1)*sizeof(struct dns_cstr)+
|
|
txt=local_malloc(sizeof(struct txt_rdata) +(n-1)*sizeof(struct dns_cstr)+
|
|
str_size);
|
|
str_size);
|
|
if(unlikely(txt==0)){
|
|
if(unlikely(txt==0)){
|
|
- LOG(L_ERR, "ERROR: dns_txt_parser: out of memory\n");
|
|
|
|
|
|
+ LM_ERR("out of memory\n");
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
/* string table */
|
|
/* string table */
|
|
@@ -637,7 +633,7 @@ static struct ebl_rdata* dns_ebl_parser(unsigned char* msg, unsigned char* end,
|
|
/* alloc sizeof struct + space for the 2 null-terminated strings */
|
|
/* alloc sizeof struct + space for the 2 null-terminated strings */
|
|
ebl=local_malloc(sizeof(struct ebl_rdata)-1+sep_len+1+apex_len+1);
|
|
ebl=local_malloc(sizeof(struct ebl_rdata)-1+sep_len+1+apex_len+1);
|
|
if (ebl==0){
|
|
if (ebl==0){
|
|
- LOG(L_ERR, "ERROR: dns_ebl_parser: out of memory\n");
|
|
|
|
|
|
+ LM_ERR("out of memory\n");
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
ebl->position=rdata[0];
|
|
ebl->position=rdata[0];
|
|
@@ -675,7 +671,7 @@ struct ptr_rdata* dns_ptr_parser( unsigned char* msg, unsigned char* end,
|
|
/* alloc sizeof struct + space for the null terminated name */
|
|
/* alloc sizeof struct + space for the null terminated name */
|
|
pname=local_malloc(sizeof(struct ptr_rdata)-1+len+1);
|
|
pname=local_malloc(sizeof(struct ptr_rdata)-1+len+1);
|
|
if(pname==0){
|
|
if(pname==0){
|
|
- LOG(L_ERR, "ERROR: dns_ptr_parser: out of memory\n");
|
|
|
|
|
|
+ LM_ERR("out of memory\n");
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
pname->ptrdname_len=len;
|
|
pname->ptrdname_len=len;
|
|
@@ -786,7 +782,7 @@ struct rdata* get_record(char* name, int type, int flags)
|
|
for (r=0; r<qno; r++){
|
|
for (r=0; r<qno; r++){
|
|
/* skip the name of the question */
|
|
/* skip the name of the question */
|
|
if (unlikely((p=dns_skipname(p, end))==0)) {
|
|
if (unlikely((p=dns_skipname(p, end))==0)) {
|
|
- LOG(L_ERR, "ERROR: get_record: skipname==0\n");
|
|
|
|
|
|
+ LM_ERR("skipname==0\n");
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
p+=2+2; /* skip QCODE & QCLASS */
|
|
p+=2+2; /* skip QCODE & QCLASS */
|
|
@@ -795,7 +791,7 @@ struct rdata* get_record(char* name, int type, int flags)
|
|
p+=1+2+2; /* skip the ending '\0, QCODE and QCLASS */
|
|
p+=1+2+2; /* skip the ending '\0, QCODE and QCLASS */
|
|
#endif
|
|
#endif
|
|
if (unlikely(p>end)) {
|
|
if (unlikely(p>end)) {
|
|
- LOG(L_ERR, "ERROR: get_record: p>=end\n");
|
|
|
|
|
|
+ LM_ERR("p>=end\n");
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -805,21 +801,21 @@ again:
|
|
#if 0
|
|
#if 0
|
|
/* ignore it the default domain name */
|
|
/* ignore it the default domain name */
|
|
if ((p=dns_skipname(p, end))==0) {
|
|
if ((p=dns_skipname(p, end))==0) {
|
|
- LOG(L_ERR, "ERROR: get_record: skip_name=0 (#2)\n");
|
|
|
|
|
|
+ LM_ERR("get_record: skip_name=0 (#2)\n");
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
#else
|
|
#else
|
|
if (unlikely((skip=dn_expand(buff.buff, end, p, rec_name,
|
|
if (unlikely((skip=dn_expand(buff.buff, end, p, rec_name,
|
|
MAX_DNS_NAME-1))==-1)){
|
|
MAX_DNS_NAME-1))==-1)){
|
|
- LOG(L_ERR, "ERROR: get_record: dn_expand(rec_name) failed\n");
|
|
|
|
|
|
+ LM_ERR("dn_expand(rec_name) failed\n");
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
p+=skip;
|
|
p+=skip;
|
|
rec_name_len=strlen(rec_name);
|
|
rec_name_len=strlen(rec_name);
|
|
if (unlikely(rec_name_len>255)){
|
|
if (unlikely(rec_name_len>255)){
|
|
- LOG(L_ERR, "ERROR: get_record: dn_expand(rec_name): name too"
|
|
|
|
- " long (%d)\n", rec_name_len);
|
|
|
|
|
|
+ LM_ERR("dn_expand(rec_name): name too long (%d)\n",
|
|
|
|
+ rec_name_len);
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
/* check if enough space is left for type, class, ttl & size */
|
|
/* check if enough space is left for type, class, ttl & size */
|
|
@@ -852,7 +848,7 @@ again:
|
|
rd=(struct rdata*) local_malloc(sizeof(struct rdata)+rec_name_len+
|
|
rd=(struct rdata*) local_malloc(sizeof(struct rdata)+rec_name_len+
|
|
1-1);
|
|
1-1);
|
|
if (rd==0){
|
|
if (rd==0){
|
|
- LOG(L_ERR, "ERROR: get_record: out of memory\n");
|
|
|
|
|
|
+ LM_ERR("out of memory\n");
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
rd->type=rtype;
|
|
rd->type=rtype;
|
|
@@ -954,7 +950,7 @@ again:
|
|
last=&(rd->next);
|
|
last=&(rd->next);
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
- LOG(L_ERR, "WARNING: get_record: unknown type %d\n", rtype);
|
|
|
|
|
|
+ LM_ERR("unknown type %d\n", rtype);
|
|
rd->rdata=0;
|
|
rd->rdata=0;
|
|
*last=rd;
|
|
*last=rd;
|
|
last=&(rd->next);
|
|
last=&(rd->next);
|
|
@@ -973,7 +969,7 @@ again:
|
|
for (r=0; (r<answers_no) && (p<end); r++){
|
|
for (r=0; (r<answers_no) && (p<end); r++){
|
|
/* skip over the ns records */
|
|
/* skip over the ns records */
|
|
if ((p=dns_skipname(p, end))==0) {
|
|
if ((p=dns_skipname(p, end))==0) {
|
|
- LOG(L_ERR, "ERROR: get_record: skip_name=0 (#3)\n");
|
|
|
|
|
|
+ LM_ERR("skip_name=0 (#3)\n");
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
/* check if enough space is left for type, class, ttl & size */
|
|
/* check if enough space is left for type, class, ttl & size */
|
|
@@ -996,7 +992,7 @@ again:
|
|
if ((search_list_used==1)&&(fullname_rd!=0)) {
|
|
if ((search_list_used==1)&&(fullname_rd!=0)) {
|
|
rd=(struct rdata*) local_malloc(sizeof(struct rdata)+name_len+1-1);
|
|
rd=(struct rdata*) local_malloc(sizeof(struct rdata)+name_len+1-1);
|
|
if (unlikely(rd==0)){
|
|
if (unlikely(rd==0)){
|
|
- LOG(L_ERR, "ERROR: get_record: out of memory\n");
|
|
|
|
|
|
+ LM_ERR("out of memory\n");
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
rd->type=T_CNAME;
|
|
rd->type=T_CNAME;
|
|
@@ -1010,7 +1006,7 @@ again:
|
|
rd->rdata=(void*)local_malloc(sizeof(struct cname_rdata)-1+
|
|
rd->rdata=(void*)local_malloc(sizeof(struct cname_rdata)-1+
|
|
head->name_len+1);
|
|
head->name_len+1);
|
|
if(unlikely(rd->rdata==0)){
|
|
if(unlikely(rd->rdata==0)){
|
|
- LOG(L_ERR, "ERROR: get_record: out of memory\n");
|
|
|
|
|
|
+ LM_ERR("out of memory\n");
|
|
goto error_rd;
|
|
goto error_rd;
|
|
}
|
|
}
|
|
((struct cname_rdata*)(rd->rdata))->name_len=fullname_rd->name_len;
|
|
((struct cname_rdata*)(rd->rdata))->name_len=fullname_rd->name_len;
|
|
@@ -1022,19 +1018,19 @@ again:
|
|
|
|
|
|
return head;
|
|
return head;
|
|
error_boundary:
|
|
error_boundary:
|
|
- LOG(L_ERR, "ERROR: get_record: end of query buff reached\n");
|
|
|
|
|
|
+ LM_ERR("end of query buff reached\n");
|
|
if (head) free_rdata_list(head);
|
|
if (head) free_rdata_list(head);
|
|
return 0;
|
|
return 0;
|
|
error_parse:
|
|
error_parse:
|
|
- LOG(L_ERR, "ERROR: get_record: rdata parse error (%s, %d), %p-%p"
|
|
|
|
- " rtype=%d, class=%d, ttl=%d, rdlength=%d \n",
|
|
|
|
|
|
+ LM_ERR("rdata parse error (%s, %d), %p-%p"
|
|
|
|
+ " rtype=%d, class=%d, ttl=%d, rdlength=%d\n",
|
|
name, type,
|
|
name, type,
|
|
p, end, rtype, class, ttl, rdlength);
|
|
p, end, rtype, class, ttl, rdlength);
|
|
error_rd:
|
|
error_rd:
|
|
if (rd) local_free(rd); /* rd->rdata=0 & rd is not linked yet into
|
|
if (rd) local_free(rd); /* rd->rdata=0 & rd is not linked yet into
|
|
the list */
|
|
the list */
|
|
error:
|
|
error:
|
|
- LOG(L_ERR, "ERROR: get_record \n");
|
|
|
|
|
|
+ LM_ERR("get_record\n");
|
|
if (head) free_rdata_list(head);
|
|
if (head) free_rdata_list(head);
|
|
not_found:
|
|
not_found:
|
|
/* increment error counter */
|
|
/* increment error counter */
|
|
@@ -1234,7 +1230,7 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port,
|
|
srv_head=0;
|
|
srv_head=0;
|
|
srv_target=0;
|
|
srv_target=0;
|
|
if (name->len >= MAX_DNS_NAME) {
|
|
if (name->len >= MAX_DNS_NAME) {
|
|
- LOG(L_ERR, "srv_sip_resolvehost: domain name too long\n");
|
|
|
|
|
|
+ LM_ERR("domain name too long\n");
|
|
he=0;
|
|
he=0;
|
|
goto end;
|
|
goto end;
|
|
}
|
|
}
|
|
@@ -1277,8 +1273,8 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port,
|
|
goto end;
|
|
goto end;
|
|
}
|
|
}
|
|
if ((name->len+SRV_MAX_PREFIX_LEN+1)>MAX_DNS_NAME){
|
|
if ((name->len+SRV_MAX_PREFIX_LEN+1)>MAX_DNS_NAME){
|
|
- LOG(L_WARN, "WARNING: srv_sip_resolvehost: domain name too long (%d),"
|
|
|
|
- " unable to perform SRV lookup\n", name->len);
|
|
|
|
|
|
+ LM_WARN("domain name too long (%d), unable to perform SRV lookup\n",
|
|
|
|
+ name->len);
|
|
}else{
|
|
}else{
|
|
|
|
|
|
switch(srv_proto){
|
|
switch(srv_proto){
|
|
@@ -1289,8 +1285,7 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port,
|
|
create_srv_name(srv_proto, name, tmp);
|
|
create_srv_name(srv_proto, name, tmp);
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
- LOG(L_CRIT, "BUG: srv_sip_resolvehost: unknown proto %d\n",
|
|
|
|
- srv_proto);
|
|
|
|
|
|
+ LM_CRIT("unknown proto %d\n", srv_proto);
|
|
he=0;
|
|
he=0;
|
|
goto end;
|
|
goto end;
|
|
}
|
|
}
|
|
@@ -1301,7 +1296,7 @@ do_srv:
|
|
if (l->type!=T_SRV) continue;
|
|
if (l->type!=T_SRV) continue;
|
|
srv=(struct srv_rdata*) l->rdata;
|
|
srv=(struct srv_rdata*) l->rdata;
|
|
if (srv==0){
|
|
if (srv==0){
|
|
- LOG(L_CRIT, "srv_sip_resolvehost: BUG: null rdata\n");
|
|
|
|
|
|
+ LM_CRIT("null rdata\n");
|
|
/* cleanup on exit only */
|
|
/* cleanup on exit only */
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -1322,7 +1317,7 @@ do_srv:
|
|
if (l->type!=T_SRV) continue; /*should never happen*/
|
|
if (l->type!=T_SRV) continue; /*should never happen*/
|
|
srv=(struct srv_rdata*) l->rdata;
|
|
srv=(struct srv_rdata*) l->rdata;
|
|
if (srv==0){
|
|
if (srv==0){
|
|
- LOG(L_CRIT, "srv_sip_resolvehost: BUG: null rdata\n");
|
|
|
|
|
|
+ LM_CRIT("null rdata\n");
|
|
/* cleanup on exit only */
|
|
/* cleanup on exit only */
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -1412,7 +1407,7 @@ struct rdata* naptr_sip_iterate(struct rdata* naptr_head,
|
|
if (l->type!=T_NAPTR) continue;
|
|
if (l->type!=T_NAPTR) continue;
|
|
naptr=(struct naptr_rdata*) l->rdata;
|
|
naptr=(struct naptr_rdata*) l->rdata;
|
|
if (naptr==0){
|
|
if (naptr==0){
|
|
- LOG(L_CRIT, "naptr_iterate: BUG: null rdata\n");
|
|
|
|
|
|
+ LM_CRIT("null rdata\n");
|
|
goto end;
|
|
goto end;
|
|
}
|
|
}
|
|
/* check if valid and get proto */
|
|
/* check if valid and get proto */
|
|
@@ -1475,7 +1470,7 @@ void create_srv_name(char proto, str *name, char *srv) {
|
|
srv[SRV_SCTP_PREFIX_LEN + name->len] = '\0';
|
|
srv[SRV_SCTP_PREFIX_LEN + name->len] = '\0';
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
- LOG(L_CRIT, "BUG: %s: unknown proto %d\n", __func__, proto);
|
|
|
|
|
|
+ LM_CRIT("%s: unknown proto %d\n", __func__, proto);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1568,8 +1563,7 @@ struct hostent* no_naptr_srv_sip_resolvehost(str* name, unsigned short* port, ch
|
|
}
|
|
}
|
|
|
|
|
|
if ((name->len+SRV_MAX_PREFIX_LEN+1)>MAX_DNS_NAME){
|
|
if ((name->len+SRV_MAX_PREFIX_LEN+1)>MAX_DNS_NAME){
|
|
- LOG(L_WARN, "WARNING: no_naptr_srv_sip_resolvehost: domain name too long"
|
|
|
|
- " (%d), unable to perform SRV lookup\n", name->len);
|
|
|
|
|
|
+ LM_WARN("domain name too long (%d), unable to perform SRV lookup\n", name->len);
|
|
} else {
|
|
} else {
|
|
/* looping on the ordered list until we found a protocol what has srv record */
|
|
/* looping on the ordered list until we found a protocol what has srv record */
|
|
list_len = create_srv_pref_list(proto, srv_proto_list);
|
|
list_len = create_srv_pref_list(proto, srv_proto_list);
|
|
@@ -1582,8 +1576,7 @@ struct hostent* no_naptr_srv_sip_resolvehost(str* name, unsigned short* port, ch
|
|
create_srv_name(srv_proto_list[i].proto, name, tmp_srv);
|
|
create_srv_name(srv_proto_list[i].proto, name, tmp_srv);
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
- LOG(L_CRIT, "BUG: no_naptr_srv_sip_resolvehost: unknown proto %d\n",
|
|
|
|
- (int)srv_proto_list[i].proto);
|
|
|
|
|
|
+ LM_CRIT("unknown proto %d\n", (int)srv_proto_list[i].proto);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
/* set default port */
|
|
/* set default port */
|
|
@@ -1640,7 +1633,7 @@ struct hostent* naptr_sip_resolvehost(str* name, unsigned short* port,
|
|
naptr_head=0;
|
|
naptr_head=0;
|
|
he=0;
|
|
he=0;
|
|
if (name->len >= MAX_DNS_NAME) {
|
|
if (name->len >= MAX_DNS_NAME) {
|
|
- LOG(L_ERR, "naptr_sip_resolvehost: domain name too long\n");
|
|
|
|
|
|
+ LM_ERR("domain name too long\n");
|
|
goto end;
|
|
goto end;
|
|
}
|
|
}
|
|
/* try NAPTR if no port or protocol is specified and NAPTR lookup is
|
|
/* try NAPTR if no port or protocol is specified and NAPTR lookup is
|
|
@@ -1729,8 +1722,8 @@ int sip_hostport2su(union sockaddr_union* su, str* name, unsigned short port,
|
|
he=sip_resolvehost(name, &port, proto);
|
|
he=sip_resolvehost(name, &port, proto);
|
|
if (he==0){
|
|
if (he==0){
|
|
ser_error=E_BAD_ADDRESS;
|
|
ser_error=E_BAD_ADDRESS;
|
|
- LOG(L_ERR, "ERROR: sip_hostport2su: could not resolve hostname:"
|
|
|
|
- " \"%.*s\"\n", name->len, name->s);
|
|
|
|
|
|
+ LM_ERR("could not resolve hostname: \"%.*s\"\n",
|
|
|
|
+ name->len, name->s);
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
/* port filled by sip_resolvehost if empty*/
|
|
/* port filled by sip_resolvehost if empty*/
|