n->piter = GNUNET_PEERINFO_iterate (peerinfo, peer,
GNUNET_TIME_UNIT_FOREVER_REL,
&add_hello_for_peer, n);
+
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# HELLO's sent to new neighbors"),
+ 1,
+ GNUNET_NO);
transmit_to_peer (NULL, NULL, 0,
HELLO_ADDRESS_EXPIRATION,
(const char *) our_hello, GNUNET_HELLO_size(our_hello),
&neighbour->id.hashPubKey,
va,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
- hello_size = GNUNET_HELLO_size(our_hello);
+
+ if (peer_address->validated != GNUNET_YES)
+ hello_size = GNUNET_HELLO_size(our_hello);
+ else
+ hello_size = 0;
+
tsize = sizeof(struct TransportPingMessage) + hello_size;
+
if (peer_address->addr != NULL)
{
slen = strlen (tp->short_name) + 1;
ping.header.type = htons(GNUNET_MESSAGE_TYPE_TRANSPORT_PING);
ping.challenge = htonl(va->challenge);
memcpy(&ping.target, &neighbour->id, sizeof(struct GNUNET_PeerIdentity));
- memcpy(message_buf, our_hello, hello_size);
+ if (peer_address->validated != GNUNET_YES)
+ memcpy(message_buf, our_hello, hello_size);
+
if (peer_address->addr != NULL)
{
ping.header.size = htons(sizeof(struct TransportPingMessage) +
"HELLO", hello_size,
"PING");
#endif
+ if (peer_address->validated != GNUNET_YES)
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# PING+HELLO messages sent"),
+ 1,
+ GNUNET_NO);
+
+
GNUNET_STATISTICS_update (stats,
gettext_noop ("# PING messages sent for re-validation"),
1,
&((struct sockaddr_in6 *) addr)->sin6_addr,
sizeof (struct in6_addr));
GNUNET_assert(NULL != inet_ntop(AF_INET6, &t6.ipv6_addr, &buf[0], INET6_ADDRSTRLEN));
- if ((plugin->bind_address != NULL) || ((plugin->bind6_address != NULL) && (0 != strcmp(buf, plugin->bind_address))))
+ if (((plugin->bind_address != NULL) && (0 != strcmp(buf, plugin->bind_address)))
+ || ((plugin->bind6_address != NULL) && (0 != strcmp(buf, plugin->bind6_address))))
{
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s: Not notifying transport of address %s\n", "UDP", GNUNET_a2s (addr, addrlen));
return GNUNET_OK;
return;
}
- port = 0;
port_start = NULL;
for (i = 0; i < sizeof(mybuf); i++)
{