mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
fix get local address in case of 3G connectivity on ios
This commit is contained in:
parent
3969da946c
commit
e4309a8757
1 changed files with 7 additions and 2 deletions
|
|
@ -971,10 +971,15 @@ static int get_local_ip_with_getifaddrs(int type, char *address, int size)
|
|||
if (getifaddrs(&ifpstart) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifndef __linux
|
||||
#define UP_FLAG IFF_UP /* interface is up */
|
||||
#else
|
||||
#define UP_FLAG IFF_RUNNING /* resources allocated */
|
||||
#endif
|
||||
|
||||
for (ifp = ifpstart; ifp != NULL; ifp = ifp->ifa_next) {
|
||||
if (ifp->ifa_addr && ifp->ifa_addr->sa_family == type
|
||||
&& (ifp->ifa_flags & IFF_RUNNING) && !(ifp->ifa_flags & IFF_LOOPBACK))
|
||||
&& (ifp->ifa_flags & UP_FLAG) && !(ifp->ifa_flags & IFF_LOOPBACK))
|
||||
{
|
||||
getnameinfo(ifp->ifa_addr,
|
||||
(type == AF_INET6) ?
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue