Commit e6b7360a authored by Simon Morlat's avatar Simon Morlat

don't use AI_V4MAPPED for AF_INET

parent eff42770
......@@ -26,7 +26,7 @@ BELLE_SIP_BEGIN_DECLS
BELLESIP_EXPORT belle_sip_uri_t *belles_sip_provider_find_our_origin(belle_sip_provider_t *p, belle_sip_request_t *req);
BELLESIP_EXPORT unsigned char belle_sip_provider_is_us(belle_sip_provider_t *p, belle_sip_uri_t*);
BELLESIP_EXPORT int belle_sip_provider_is_us(belle_sip_provider_t *p, belle_sip_uri_t*);
BELLESIP_EXPORT int belle_sip_provider_add_listening_point(belle_sip_provider_t *p, belle_sip_listening_point_t *lp);
......
......@@ -148,7 +148,8 @@ belle_sip_channel_t *belle_sip_listening_point_get_channel(belle_sip_listening_p
belle_sip_channel_t *chan;
hints.ai_family=lp->ai_family;
hints.ai_flags=AI_NUMERICHOST|AI_NUMERICSERV|AI_V4MAPPED;
hints.ai_flags=AI_NUMERICHOST|AI_NUMERICSERV;
if (hints.ai_family==AF_INET6) hints.ai_flags|=AI_V4MAPPED;
snprintf(portstr,sizeof(portstr),"%i",hop->port);
getaddrinfo(hop->host,portstr,&hints,&res);
chan=_belle_sip_listening_point_get_channel(lp,hop,res);
......
......@@ -445,13 +445,15 @@ belle_sip_provider_t *belle_sip_provider_new(belle_sip_stack_t *s, belle_sip_lis
if (lp) belle_sip_provider_add_listening_point(p,lp);
return p;
}
#if 0
/* what is the purpose of this function incorrectly named ?*/
belle_sip_uri_t *belles_sip_provider_find_our_origin(belle_sip_provider_t *p, belle_sip_request_t *req) {
belle_sip_uri_t* origin = belle_sip_request_extract_origin(req);
belle_sip_hop_t *hop = belle_sip_hop_new_from_uri(origin);
belle_sip_channel_t *inChan = belle_sip_provider_get_channel(p, hop);
return compute_our_external_uri_from_channel(inChan);
}
#endif
static belle_sip_channel_t* _belle_sip_provider_find_channel_with_us(belle_sip_provider_t *p, belle_sip_uri_t* uri) {
const char *transport;
......@@ -478,7 +480,7 @@ static belle_sip_channel_t* _belle_sip_provider_find_channel_with_us(belle_sip_p
return NULL;
}
unsigned char belle_sip_provider_is_us(belle_sip_provider_t *p, belle_sip_uri_t* uri) {
int belle_sip_provider_is_us(belle_sip_provider_t *p, belle_sip_uri_t* uri) {
belle_sip_channel_t* chan = _belle_sip_provider_find_channel_with_us(p, uri);
return !!chan;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment