From 1a05083ed049ebbc98e6a9cf681bb47e5af62bc8 Mon Sep 17 00:00:00 2001 From: zzz <zzz@i2pmail.org> Date: Sun, 19 Dec 2021 08:38:13 -0500 Subject: [PATCH] Tunnels: Double mask value for IPv6 rather than using a fixed value of 6 so IPv6 default is now 4 --- router/java/src/net/i2p/router/util/MaskedIPSet.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/router/java/src/net/i2p/router/util/MaskedIPSet.java b/router/java/src/net/i2p/router/util/MaskedIPSet.java index 3bd0f65f25..c7ff44d5de 100644 --- a/router/java/src/net/i2p/router/util/MaskedIPSet.java +++ b/router/java/src/net/i2p/router/util/MaskedIPSet.java @@ -103,7 +103,7 @@ public class MaskedIPSet extends HashSet<String> { if (family != null) { // TODO should KNDF put a family-verified indicator in the RI, // after checking the sig, or does it matter? - // What's the threat here of not avoid ding a router + // What's the threat here of not avoiding a router // falsely claiming to be in the family? // Prefix with something so an IP can't be spoofed add('x' + family); @@ -112,14 +112,14 @@ public class MaskedIPSet extends HashSet<String> { /** * generate an arbitrary unique value for this ip/mask (mask = 1-4) - * If IPv6, force mask = 6. + * If IPv6, double the mask value * @param mask is 1-4 (number of bytes to match) */ private static String maskedIP(byte[] ip, int mask) { final StringBuilder buf = new StringBuilder(1 + (mask*2)); final char delim; if (ip.length == 16) { - mask = 6; + mask *= 2; delim = ':'; } else { delim = '.'; -- GitLab