Sybil: Don't catch all the i2pds publishing ::1

This commit is contained in:
zzz
2023-02-18 16:44:10 -05:00
parent a4f36c8e64
commit e1da8d13d7

View File

@ -116,7 +116,8 @@ public class Analysis extends JobImpl implements RouterApp, Runnable {
public static final long SHORT_REMOVE_TIME = 2*24*60*60*1000L;
public static final long DEFAULT_FREQUENCY = 24*60*60*1000L;
public static final float MIN_BLOCK_POINTS = 12.01f;
private static final byte[] IPV6_LOCALHOST = new byte[16];
static { IPV6_LOCALHOST[15] = 1; }
/** Get via getInstance() */
private Analysis(RouterContext ctx, ClientAppManager mgr, String[] args) {
@ -584,7 +585,9 @@ public class Analysis extends JobImpl implements RouterApp, Runnable {
for (RouterAddress ra : ri.getAddresses()) {
byte[] rv = ra.getIP();
if (rv != null && rv.length == 16)
return rv;
// i2pd
if (!DataHelper.eq(rv, IPV6_LOCALHOST))
return rv;
}
return null;
}