Opened 4 years ago
Last modified 3 years ago
#1877 new defect
Test Networks: Check locally supplied addresses for IPv6
Reported by: | Obscuratus | Owned by: | zzz |
---|---|---|---|
Priority: | minor | Milestone: | 0.9.28 |
Component: | router/transport | Version: | 0.9.27 |
Keywords: | Cc: | ||
Parent Tickets: | Sensitive: | no |
Description
This trac ticket is to support local, sand-boxed testing networks running on private, normally unreachable IP addresses.
Normally, for a typical user, I2P will automatically detect the users IPv6 address, and everything works like it it supposed to.
On testing networks operating on private IPv6 address segments, you need to explicitly tell I2P to use the private IPv6 address (on the console network configuration page).
There is a minor nuance in the way IPv6 addresses are provisioned when you explicitly instruct I2P to use an IPv6 address. The _haveIPv6Address variable is not being set correctly. This causes I2P to skip Peer Testing for this IPv6 connection.
In order to test IPv6 peer testing on a testing network, I found I needed to make the following change:
router/transport: Check locally supplied addresses for IPv6 _haveIPv6Address is not being set when a IPv6 address is locally supplied. Set it so that IPv6 reachability testing will be performed on locally supplied IPv6 addresses as long as introducers are not required. Signed-off-by: obscuratus <obscuratus@mail.i2p> --- 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 e076f66..a68b318 100644 --- a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java +++ b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java @@ -2192,6 +2192,8 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority // via CSFI.createAddresses->TM.getAddresses()->updateAddress()->REA if (allowRebuildRouterInfo) _context.router().rebuildRouterInfo(); + if (isIPv6 && !introducersRequired) + _haveIPv6Address = true; } else { addr = null; }
Subtickets
Change History (5)
comment:1 Changed 4 years ago by
Component: | unspecified → router/transport |
---|---|
Owner: | set to zzz |
comment:2 Changed 4 years ago by
Milestone: | undecided → 0.9.28 |
---|---|
Status: | new → infoneeded_new |
comment:3 Changed 4 years ago by
No, the above won't work, SOURCE_CONFIG is only used for SSU to send to NTCP.
But how about something near the bottom of startup() - around line 550 or so…
comment:4 Changed 4 years ago by
Status: | infoneeded_new → new |
---|
OK, I'll look into relocating this change.
I'll start around line 550. That might work.
comment:5 Changed 3 years ago by
I apologize for letting this bug repeat languish.
I got lost trying to follow the logic for provisioning the transport addresses, and set the task aside.
Unfortunately, I lost track of this bug report.
So, on to business.
I've run into difficulty trying to find a more appropriate place in the code to conduct the test for _haveIPv6Address in the context of a local testing network.
When examining the location suggested in Comment 3 (around line 550), I've found that I never traverse that section of code during startup when I'm operating on local address in a testing network.
I'm finding that the list of transports provided by getSavedLocalAddresses() is empty when running on a local network, so no addresses are available for evaluation in this section. Local addresses are evaluated with another method.
I have located an alternative location for testing for _haveIPv6Address as shown in the following patch.
If this is not acceptable, it would be fine with me to simply close this bug at this point. It's not a big deal for me to carry this patch locally when building up my test network builds.
@@ -2264,6 +2301,14 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority cost--; else if (config == IPV6_NOT_PREFERRED) cost++; + // We now know we have an IPv6 address. When allowLocal() is true + // (usually a testing environment), assume _haveIPv6Address is true. + if (allowLocal()) + _haveIPv6Address = true; } RouterAddress addr = new RouterAddress(STYLE, options, cost);
That seems to be like the wrong place to put it.
Not sure if externalAddressReceived() is called with SOURCE_CONFIG in your scenario…
would this work?