mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Fix chosen bind IP when multicast is activated.
This commit is contained in:
parent
e60e2d4f2b
commit
6f6e1637d9
1 changed files with 2 additions and 2 deletions
|
|
@ -1131,12 +1131,12 @@ string MediaSessionPrivate::getBindIpForStream (int streamIndex) {
|
|||
/* As multicast sender, we must decide a local interface to use to send multicast, and bind to it */
|
||||
char multicastBindIp[LINPHONE_IPADDR_SIZE];
|
||||
memset(multicastBindIp, 0, sizeof(multicastBindIp));
|
||||
linphone_core_get_local_ip_for(pc->multicastIp.find_first_of(':') ? AF_INET6 : AF_INET, nullptr, multicastBindIp);
|
||||
linphone_core_get_local_ip_for((pc->multicastIp.find_first_of(':') == string::npos) ? AF_INET : AF_INET6, nullptr, multicastBindIp);
|
||||
bindIp = pc->multicastBindIp = multicastBindIp;
|
||||
} else {
|
||||
/* Otherwise we shall use an address family of the same family of the multicast address, because
|
||||
* dual stack socket and multicast don't work well on Mac OS (linux is OK, as usual). */
|
||||
bindIp = pc->multicastIp.find_first_of(':') ? "::0" : "0.0.0.0";
|
||||
bindIp = (pc->multicastIp.find_first_of(':') == string::npos) ? "0.0.0.0" : "::0";
|
||||
}
|
||||
}
|
||||
return bindIp;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue