SSU2: Enable for Android, ARM, and 2% of others

This commit is contained in:
zzz
2022-08-10 08:11:11 -04:00
parent ec6e9b1bfb
commit e35d173982
3 changed files with 30 additions and 3 deletions

View File

@@ -1,3 +1,17 @@
2022-08-10 zzz
* SSU2: Enable for Android, ARM, and 2% of others
2022-08-06 zzz
* GeoIP 2022-08
* Router: Hopefully fix clock/job queue deadlock after clock shift
2022-08-05 zzz
* SSU: Try to keep a mix of v1/v2 introducers
2022-08-04 zzz
* i2ptunnel: New outproxy (new installs only)
* SSU2: Block bob's IP in relay response from charlie
2022-08-02 zzz
* SSU2: More Path challenge WIP

View File

@@ -18,10 +18,10 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Git";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 14;
public final static long BUILD = 15;
/** for example "-test" */
public final static String EXTRA = "";
public final static String EXTRA = "-rc";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
public static void main(String args[]) {
System.out.println("I2P Router version: " + FULL_VERSION);

View File

@@ -87,6 +87,8 @@ public class TransportManager implements TransportEventListener {
* @since 0.9.54
*/
public final static String PROP_ENABLE_SSU2 = "i2np.ssu2.enable";
/** 1 in this many */
private static final int SSU2_ENABLE_PROBABILITY = 50;
/** default true */
public final static String PROP_ENABLE_NTCP = "i2np.ntcp.enable";
/** default true */
@@ -259,7 +261,18 @@ public class TransportManager implements TransportEventListener {
private void configTransports() {
Transport udp = null;
if (_enableUDP) {
X25519KeyFactory xdh = _context.getBooleanProperty(PROP_ENABLE_SSU2) ? _xdhThread : null;
String ssu2 = _context.getProperty(PROP_ENABLE_SSU2);
boolean enableSSU2 = false;
if (ssu2 == null) {
// Migration, to be removed when we change to default true
if (SystemVersion.isSlow() || _context.random().nextInt(SSU2_ENABLE_PROBABILITY) == 0) {
enableSSU2 = true;
_context.router().saveConfig(PROP_ENABLE_SSU2, "true");
}
} else {
enableSSU2 = Boolean.parseBoolean(ssu2);
}
X25519KeyFactory xdh = enableSSU2 ? _xdhThread : null;
udp = new UDPTransport(_context, _dhThread, xdh);
addTransport(udp);
initializeAddress(udp);