1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## always_ipv4_for_ipv4 hosts.dpatch by Lionel Elie Mamane <lionel@mamane.lu>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Identify with IPv4 address to IPv4 host even if it has an AAAA DNS RR
8
--- linphone-3.2.1.orig/coreapi/linphonecore.c
9
+++ linphone-3.2.1/coreapi/linphonecore.c
13
if (dest==NULL) dest="87.98.157.38"; /*a public IP address*/
14
- if (linphone_core_get_local_ip_for(dest,result)==0)
15
+ if (linphone_core_get_local_ip_for(lc->sip_conf.ipv6_enabled ? AF_INET6 : AF_INET, dest,result)==0)
17
/*else fallback to exosip routine that will attempt to find the most realistic interface */
18
if (eXosip_guess_localip(lc->sip_conf.ipv6_enabled ? AF_INET6 : AF_INET,result,LINPHONE_IPADDR_SIZE)<0){
21
--- linphone-3.2.1.orig/coreapi/misc.c
22
+++ linphone-3.2.1/coreapi/misc.c
27
-int linphone_core_get_local_ip_for(const char *dest, char *result){
28
+int linphone_core_get_local_ip_for(int family, const char *dest, char *result){
30
struct addrinfo hints;
31
struct addrinfo *res=NULL;
35
memset(&hints,0,sizeof(hints));
36
- hints.ai_family=PF_UNSPEC;
37
+ hints.ai_family=family;
38
hints.ai_socktype=SOCK_DGRAM;
39
/*hints.ai_flags=AI_NUMERICHOST|AI_CANONNAME;*/
40
err=getaddrinfo(dest,"5060",&hints,&res);
43
--- linphone-3.2.1.orig/coreapi/private.h
44
+++ linphone-3.2.1/coreapi/private.h
46
void linphone_proxy_config_update(LinphoneProxyConfig *cfg);
47
void linphone_proxy_config_get_contact(LinphoneProxyConfig *cfg, const char **ip, int *port);
48
LinphoneProxyConfig * linphone_core_lookup_known_proxy(LinphoneCore *lc, const char *uri);
49
-int linphone_core_get_local_ip_for(const char *dest, char *result);
50
+int linphone_core_get_local_ip_for(int family, const char *dest, char *result);
52
#endif /* _PRIVATE_H */