diff options
| author | Michael Peter Christen <mc@yacy.net> | 2013-08-01 12:35:44 +0200 |
|---|---|---|
| committer | Michael Peter Christen <mc@yacy.net> | 2013-08-01 12:35:44 +0200 |
| commit | 2674d28ef4b555c1374d27262c539e595b780715 (patch) | |
| tree | 73df1d6401aebd9e4214bfd445b650d0397286f1 | |
| parent | 944ae5686cdd01f9c41a9715cdf924281627a29e (diff) | |
protection against self-ping (may be cause by fraud attempts)
| -rw-r--r-- | htroot/yacy/hello.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/htroot/yacy/hello.java b/htroot/yacy/hello.java index 014ab723b..7e27d4684 100644 --- a/htroot/yacy/hello.java +++ b/htroot/yacy/hello.java @@ -113,8 +113,14 @@ public final class hello { final String reportedPeerType = remoteSeed.get(Seed.PEERTYPE, Seed.PEERTYPE_JUNIOR);
final double clientversion = remoteSeed.getVersion();
+ if ((reportedip + ':' + remoteSeed.getPort()).equals(sb.peers.mySeed().getPublicAddress())) {
+ // reject a self-ping
+ prop.put("message", "I am I");
+ return prop;
+ }
+
if (sb.isRobinsonMode() && !sb.isPublicRobinson()) {
- // if we are a robinson cluster, answer only if this client is known by our network definition
+ // if we are a robinson cluster, answer only if this client is known by our network definition
prop.put("message", "I am robinson, I do not answer");
return prop;
}
|
