In case of any relevance, in order to get IPv6 only SIMS working I had to apply the following patch (to what is an older version now, for sure):
Built from source:
https://webrtc.googlesource.com/src/Checked out at 00d0f178c2e0eb4b28b87d09716c5d6c6edb81ab
(matches
https://bintray.com/google/webrtc/google-webrtc/1.0.30039)
with the following patch applied:
diff --git a/sdk/android/api/org/webrtc/NetworkMonitorAutoDetect.java b/sdk/android/api/org/webrtc/NetworkMonitorAutoDetect.java
index 0ac469c..4559c4d 100644
--- a/sdk/android/api/org/webrtc/NetworkMonitorAutoDetect.java
+++ b/sdk/android/api/org/webrtc/NetworkMonitorAutoDetect.java
@@ -33,6 +33,7 @@ import android.telephony.TelephonyManager;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
+import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -471,13 +472,45 @@ public class NetworkMonitorAutoDetect extends BroadcastReceiver {
@SuppressLint("NewApi")
IPAddress[] getIPAddresses(LinkProperties linkProperties) {
- IPAddress[] ipAddresses = new IPAddress[linkProperties.getLinkAddresses().size()];
- int i = 0;
- for (LinkAddress linkAddress : linkProperties.getLinkAddresses()) {
- ipAddresses[i] = new IPAddress(linkAddress.getAddress().getAddress());
- ++i;
- }
- return ipAddresses;
+ ArrayList<IPAddress> retVal = new ArrayList<>();
+ for (LinkAddress linkAddress : linkProperties.getLinkAddresses()) {
+ retVal.add(new IPAddress(linkAddress.getAddress().getAddress()));
+ }
+ // IP address(es) from any "stacked" 464XLAT interface not yet included
+ // see:
https://bugs.chromium.org/p/webrtc/issues/detail?id=9925+ addStackedIPAddresses(linkProperties, retVal);
+ return retVal.toArray(new IPAddress[0]);
+ }
+
+ private void addStackedIPAddresses(LinkProperties linkProperties, ArrayList<IPAddress> addTo) {
+ // required info from the "stacked" interface only available via @hide methods in LinkProperties
+ // but *is* available from LinkProperties.toString(): not ideal, but only option w/o radical change
+ String str = linkProperties.toString();
+ int startSearch = str.indexOf("Stacked");
+ if (-1 != startSearch) {
+ // LinkAddresses: [
192.0.0.4/32,]
+ int linkAddressesIdx;
+ do {
+ linkAddressesIdx = str.indexOf("LinkAddresses", startSearch);
+ if (-1 != linkAddressesIdx) {
+ int start = str.indexOf('[', linkAddressesIdx);
+ if (-1 != start) {
+ int end = str.indexOf(']', start);
+ if (-1 != end) {
+ for (String ipStr : str.substring(start+1, end).split(",")) {
+ try {
+ addTo.add(new IPAddress(
+ InetAddress.getByName(ipStr.replaceAll("/32", "").trim()).getAddress()));
+ } catch (UnknownHostException e) {
+ Logging.e(TAG, "Stacked Link InetAddress could not be parsed from " + ipStr, e);
+ }
+ }
+ }
+ }
+ startSearch = linkAddressesIdx + 1;
+ }
+ } while (-1 != linkAddressesIdx);
+ }
}
@SuppressLint("NewApi")