Gather ICE candidates only from one public IP
We are using libnice (tested with the newest release 0.1.19) on an Android device, which has up to two interfaces which have a connection to the internet:
- mobile interface (wwan0)
- wifi station interface (wlan0) Additional to that, we have some local interfaces (softap, eth, etc) without direct internet connection.
When I run the libnice example:
./simple-example 0 18.191.223.12
(18.191.223.12 was the IP I got from host -4 -t A stun.stunprotocol.org
)
The result is:
7qfa ... 1,... 16,2015364607,<IP wlan0>,60615,host 17,1015023103,<IP wlan0>,0,host 18,1010828799,<IP wlan0>,36705,host 19,2015364863,<IP wwan0>,44463,host 20,1015023359,10.<IP wwan0>,0,host 21,1010829055,<IP wwan0>,53851,host 22,... 25,1679820287,<Public IP wlan0>,60615,srflx 26,847250943,<Public IP wlan0>,0,srflx 27,843056639,<Public IP wlan0>,36705,srflx
As it can be seen from the candidates 25-27 I only get the srflx candidates of one address (from station interface wlan0).
If I disable the station interface I receive the ICE candidates from the the mobile interface. I then get:
GIvN ... 1,... 13,2015364351,<IP wwan0>,44381,host 14,1015022847,<IP wwan0>,0,host 15,1010828543,<IP wwan0>,54659,host 16,... 19,1679820031,<Public IP wwan0>,44381,srflx 20,847250687,<Public IP wwan0>,0,srflx 21,843056383,<Public IP wwan0>,54659,srflx
If I try to ping with a interface specification (ping -I wwan0 google.com
or ping -I wlan0 google.com
) it works without problem.
Do I need to specify anything special on the libnice to allow multiple interfaces, or should that work out of the box?