-#if KEEP_093_COMPATIBILITY
- int idsize = sizeof (GST_my_identity);
- if (alen <= idsize)
- {
- if (0 == memcmp (address.address, &GST_my_identity, alen))
- buggy = GNUNET_YES;
- }
- else if (alen <= (idsize + strlen (address.transport_name)))
- {
- char *achar = (char *) &address.address;
- if ((0 == memcmp (address.address, &GST_my_identity, idsize)) &&
- (0 == memcmp (&achar[idsize], address.transport_name, alen - idsize)))
- buggy = GNUNET_YES;
- }
- else
- {
- /* Not predicatable */
- return;
- }
-#endif
- if (GNUNET_NO == buggy)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Not confirming PING from peer `%s' with address `%s' since I cannot confirm having this address.\n",
- GNUNET_i2s (sender),
- GST_plugins_a2s (&address));
- return;
- }
- else
- {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- _("Received a PING message with validation bug from `%s'\n"),
- GNUNET_i2s (sender));
- }
+ plugin_name = GNUNET_strdup (address.transport_name);
+ pos = strstr (plugin_name, "_client");
+ GNUNET_assert (NULL != pos);
+ GNUNET_snprintf (pos, strlen ("_server") + 1, "%s", "_server");
+ }
+ else
+ plugin_name = GNUNET_strdup (address.transport_name);
+
+ if (NULL == (papi = GST_plugins_find (plugin_name)))
+ {
+ /* we don't have the plugin for this address */
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _("Plugin `%s' not available, cannot confirm having this address\n"),
+ plugin_name);
+ GNUNET_free (plugin_name);
+ return GNUNET_SYSERR;
+ }
+ GNUNET_free (plugin_name);
+ if (GNUNET_OK !=
+ papi->check_address (papi->cls,
+ addrend,
+ len_address))
+ {
+ GNUNET_STATISTICS_update (GST_stats,
+ gettext_noop
+ ("# failed address checks during validation"), 1,
+ GNUNET_NO);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _("Address `%s' is not one of my addresses, not confirming PING\n"),
+ GST_plugins_a2s (&address));
+ return GNUNET_SYSERR;
+ }
+ else
+ {
+ GNUNET_STATISTICS_update (GST_stats,
+ gettext_noop
+ ("# successful address checks during validation"), 1,
+ GNUNET_NO);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Address `%s' is one of my addresses, confirming PING\n",
+ GST_plugins_a2s (&address));
+ }
+
+ if (GNUNET_YES !=
+ GST_hello_test_address (&address,
+ &sig_cache,
+ &sig_cache_exp))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _("Not confirming PING from peer `%s' with address `%s' since I cannot confirm having this address.\n"),
+ GNUNET_i2s (sender),
+ GST_plugins_a2s (&address));
+ return GNUNET_SYSERR;