Skip to content

Commit 105941b

Browse files
committed
net: use stronger AddLocal() for our I2P address
There are two issues: 1. Our I2P address not added to local addresses. * `externalip=` is used with an IPv4 address (this sets automatically `discover=0`) * No `discover=1` is used * `i2psam=` is used * No `externalip=` is used for our I2P address * `listenonion=1 torcontrol=` are used In this case `AddLocal(LOCAL_MANUAL)` is used for our `.onion` address and `AddLocal(LOCAL_BIND)` for our `.b32.i2p` address, the latter being ignored due to `discover=0`. 2. Our I2P address removed from local addresses even if specified with `externalip=` on I2P proxy restart. * `externalip=` is used with our I2P address (this sets automatically `discover=0`) * No `discover=1` is used * `i2psam=` is used In this case, initially `externalip=` causes our I2P address to be added with `AddLocal(LOCAL_MANUAL)` which overrides `discover=0` and works as expected. However, if later the I2P proxy is shut down we do `RemoveLocal()` in order to stop advertising our I2P address (since we have lost I2P connectivity). When the I2P proxy is started and we reconnect to it, restoring the I2P connectivity, we do `AddLocal(LOCAL_BIND)` which does nothing due to `discover=0`. To resolve those two issues, use `AddLocal(LOCAL_MANUAL)` for I2P which is also what we do with Tor.
1 parent 39e3060 commit 105941b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2244,7 +2244,7 @@ void CConnman::ThreadI2PAcceptIncoming()
22442244
}
22452245

22462246
if (!advertising_listen_addr) {
2247-
AddLocal(conn.me, LOCAL_BIND);
2247+
AddLocal(conn.me, LOCAL_MANUAL);
22482248
advertising_listen_addr = true;
22492249
}
22502250

0 commit comments

Comments
 (0)