}
-
-
-
/**
- * Function called by the plugin for each received message.
- * Update data volumes, possibly notify plugins about
- * reducing the rate at which they read from the socket
- * and generally forward to our receive callback.
+ * Function called by the plugin for each received message. Update
+ * data volumes, possibly notify plugins about reducing the rate at
+ * which they read from the socket and generally forward to our
+ * receive callback.
*
* @param cls the "struct TransportPlugin *" we gave to the plugin
* @param peer (claimed) identity of the other peer
uint32_t distance;
int c;
+ if (0 == memcmp (peer,
+ &my_identity,
+ sizeof (struct GNUNET_PeerIdentity)))
+ {
+ /* refuse to receive from myself */
+ GNUNET_break (0);
+ return GNUNET_TIME_UNIT_FOREVER_REL;
+ }
if (is_blacklisted (peer, plugin))
return GNUNET_TIME_UNIT_FOREVER_REL;
n = find_neighbour (peer);
if (ntohs(message->size) != sizeof(struct TCP_NAT_ProbeMessage))
{
GNUNET_break_op(0);
+ GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+ return;
+ }
+ if (0 == memcmp (&tcp_nat_probe->clientIdentity,
+ plugin->env->my_identity,
+ sizeof (struct GNUNET_PeerIdentity)))
+ {
+ /* refuse connections from ourselves */
+ GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
return;
}
tcp_nat_probe = (const struct TCP_NAT_ProbeMessage *)message;
struct IPv6TcpAddress *t6;
const struct sockaddr_in *s4;
const struct sockaddr_in6 *s6;
-
+
+ if (0 == memcmp (&wm->clientIdentity,
+ plugin->env->my_identity,
+ sizeof (struct GNUNET_PeerIdentity)))
+ {
+ /* refuse connections from ourselves */
+ GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+ return;
+ }
#if DEBUG_TCP
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
"tcp",