- should use BIO instead of mmap
* TRANSPORT:
- need to periodically probe latency/transport cost changes & possibly switch transport
- - instantly filter addresses from *other* peers that
- are *equal* to our own address + port (i.e., localhost:2086). We
- no longer filter those for outgoing (helps with loopback testing
- and keeps the code clean), but we should filter strictly *impossible*
- incoming addresses! This is for efficiency, not correctness.
- should use hash map to look up Neighbours (service AND plugins!)
* HOSTLIST:
- 'server' uses 'GNUNET_PEERINFO_iterate', should probably switch to notification API
struct ValidationEntry *va;
struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pk;
struct CheckAddressExistsClosure caec;
+ struct OwnAddressList *oal;
GNUNET_assert (addr != NULL);
GNUNET_STATISTICS_update (stats,
("Transport `%s' not loaded, will not try to validate peer address using this transport.\n"),
tname);
GNUNET_STATISTICS_update (stats,
- gettext_noop ("# peer addresses not validated (no applicable transport plugin available)"),
+ gettext_noop ("# peer addresses not validated (plugin not available)"),
1,
GNUNET_NO);
return GNUNET_OK;
}
+ /* check if this is one of our own addresses */
+ oal = tp->addresses;
+ while (NULL != oal)
+ {
+ if ( (oal->addrlen == addrlen) &&
+ (0 == memcmp (oal->addr,
+ addr,
+ addrlen)) )
+ {
+ /* not plausible, this address is equivalent to our own address! */
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# peer addresses not validated (loopback)"),
+ 1,
+ GNUNET_NO);
+ return GNUNET_OK;
+ }
+ oal = oal->next;
+ }
GNUNET_HELLO_get_key (chvc->hello, &pk);
GNUNET_CRYPTO_hash (&pk,
sizeof (struct
gettext_noop ("# bytes TCP was asked to transmit"),
msgbuf_size,
GNUNET_NO);
- /* FIXME: we could do this a cheaper with a hash table
+ /* FIXME: we could do this cheaper with a hash table
where we could restrict the iteration to entries that match
the target peer... */
if (session == NULL)
/**
* Add the IP of our network interface to the list of
* our external IP addresses.
+ *
+ * @param cls the 'struct Plugin*'
+ * @param name name of the interface
+ * @param isDefault do we think this may be our default interface
+ * @param addr address of the interface
+ * @param addrlen number of bytes in addr
*/
static int
process_interfaces (void *cls,