From e1da8d13d7769f89897b51cc7e05bcc24308e09d Mon Sep 17 00:00:00 2001
From: zzz <zzz@i2pmail.org>
Date: Sat, 18 Feb 2023 16:44:10 -0500
Subject: [PATCH] Sybil: Don't catch all the i2pds publishing ::1

---
 router/java/src/net/i2p/router/sybil/Analysis.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/router/java/src/net/i2p/router/sybil/Analysis.java b/router/java/src/net/i2p/router/sybil/Analysis.java
index cd895ee85c..c3ac82f122 100644
--- a/router/java/src/net/i2p/router/sybil/Analysis.java
+++ b/router/java/src/net/i2p/router/sybil/Analysis.java
@@ -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;
     }
-- 
GitLab