From 5763d73ddad5215ba4d02a0b633eb47b24ea0308 Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Tue, 2 Aug 2016 14:24:48 +0000
Subject: [PATCH] SSU: Fix peer test stuck when IPv6-only (ticket #1819)

---
 .../java/src/net/i2p/router/transport/udp/UDPTransport.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java
index 917bd41121..d6308e7c3d 100644
--- a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java
+++ b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java
@@ -3303,7 +3303,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
                     locked_runTest(false);
                 } else if (_haveIPv6Address &&_forceRun == FORCE_IPV6 && sinceRunV6 >= MIN_TEST_FREQUENCY) {
                     locked_runTest(true);
-                } else if (sinceRunV4 >= TEST_FREQUENCY) {
+                } else if (sinceRunV4 >= TEST_FREQUENCY && getIPv6Config() != IPV6_ONLY) {
                     locked_runTest(false);
                 } else if (_haveIPv6Address && sinceRunV6 >= TEST_FREQUENCY) {
                     locked_runTest(true);
@@ -3316,7 +3316,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
             if (_alive) {
                 long delay = (TEST_FREQUENCY / 2) + _context.random().nextInt(TEST_FREQUENCY);
                 // if we have 2 addresses, give IPv6 a chance also
-                if (_haveIPv6Address)
+                if (_haveIPv6Address && getIPv6Config() != IPV6_ONLY)
                     delay /= 2;
                 schedule(delay);
             }
-- 
GitLab