#! /bin/sh /usr/share/dpatch/dpatch-run ## always_ipv4_for_ipv4 hosts.dpatch by Lionel Elie Mamane ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Identify with IPv4 address to IPv4 host even if it has an AAAA DNS RR @DPATCH@ --- linphone-3.2.1.orig/coreapi/linphonecore.c +++ linphone-3.2.1/coreapi/linphonecore.c @@ -788,7 +788,7 @@ return; } if (dest==NULL) dest="87.98.157.38"; /*a public IP address*/ - if (linphone_core_get_local_ip_for(dest,result)==0) + if (linphone_core_get_local_ip_for(lc->sip_conf.ipv6_enabled ? AF_INET6 : AF_INET, dest,result)==0) return; /*else fallback to exosip routine that will attempt to find the most realistic interface */ if (eXosip_guess_localip(lc->sip_conf.ipv6_enabled ? AF_INET6 : AF_INET,result,LINPHONE_IPADDR_SIZE)<0){ only in patch2: unchanged: --- linphone-3.2.1.orig/coreapi/misc.c +++ linphone-3.2.1/coreapi/misc.c @@ -746,7 +746,7 @@ return -1; } -int linphone_core_get_local_ip_for(const char *dest, char *result){ +int linphone_core_get_local_ip_for(int family, const char *dest, char *result){ int err,tmp; struct addrinfo hints; struct addrinfo *res=NULL; @@ -755,7 +755,7 @@ socklen_t s; memset(&hints,0,sizeof(hints)); - hints.ai_family=PF_UNSPEC; + hints.ai_family=family; hints.ai_socktype=SOCK_DGRAM; /*hints.ai_flags=AI_NUMERICHOST|AI_CANONNAME;*/ err=getaddrinfo(dest,"5060",&hints,&res); only in patch2: unchanged: --- linphone-3.2.1.orig/coreapi/private.h +++ linphone-3.2.1/coreapi/private.h @@ -188,6 +188,6 @@ void linphone_proxy_config_update(LinphoneProxyConfig *cfg); void linphone_proxy_config_get_contact(LinphoneProxyConfig *cfg, const char **ip, int *port); LinphoneProxyConfig * linphone_core_lookup_known_proxy(LinphoneCore *lc, const char *uri); -int linphone_core_get_local_ip_for(const char *dest, char *result); +int linphone_core_get_local_ip_for(int family, const char *dest, char *result); #endif /* _PRIVATE_H */