Commit 737997cb authored by Simon Morlat's avatar Simon Morlat

fix debian-reported bug around resolution of local interface for host that...

fix debian-reported bug around resolution of local interface for host that have both ipv4 and ipv6 addresses.
parent f318833e
......@@ -684,7 +684,7 @@ static int get_local_ip_with_getifaddrs(int type, char *address, int size)
#endif
static int get_local_ip_for_with_connect(const char *dest, char *result){
static int get_local_ip_for_with_connect(int type, const char *dest, char *result){
int err,tmp;
struct addrinfo hints;
struct addrinfo *res=NULL;
......@@ -694,7 +694,7 @@ static int get_local_ip_for_with_connect(const char *dest, char *result){
socklen_t s;
memset(&hints,0,sizeof(hints));
hints.ai_family=PF_UNSPEC;
hints.ai_family=(type==AF_INET6) ? PF_INET6 : PF_INET;
hints.ai_socktype=SOCK_DGRAM;
/*hints.ai_flags=AI_NUMERICHOST|AI_CANONNAME;*/
err=getaddrinfo(dest,"5060",&hints,&res);
......@@ -765,5 +765,5 @@ int linphone_core_get_local_ip_for(int type, const char *dest, char *result){
}
#endif
/*else use connect to find the best local ip address */
return get_local_ip_for_with_connect(dest,result);
return get_local_ip_for_with_connect(type,dest,result);
}
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