[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35781 - gnunet/src/vpn
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35781 - gnunet/src/vpn |
Date: |
Fri, 22 May 2015 11:58:51 +0200 |
Author: grothoff
Date: 2015-05-22 11:58:51 +0200 (Fri, 22 May 2015)
New Revision: 35781
Modified:
gnunet/src/vpn/gnunet-service-vpn.c
Log:
-diagnose tunnel issues
Modified: gnunet/src/vpn/gnunet-service-vpn.c
===================================================================
--- gnunet/src/vpn/gnunet-service-vpn.c 2015-05-22 09:45:42 UTC (rev 35780)
+++ gnunet/src/vpn/gnunet-service-vpn.c 2015-05-22 09:58:51 UTC (rev 35781)
@@ -324,7 +324,7 @@
/**
- * Return value from 'main'.
+ * Return value from #main().
*/
static int global_ret;
@@ -445,12 +445,12 @@
*/
static void
get_channel_key_from_ips (int af,
- uint8_t protocol,
- const void *source_ip,
- uint16_t source_port,
- const void *destination_ip,
- uint16_t destination_port,
- struct GNUNET_HashCode *key)
+ uint8_t protocol,
+ const void *source_ip,
+ uint16_t source_port,
+ const void *destination_ip,
+ uint16_t destination_port,
+ struct GNUNET_HashCode *key)
{
char *off;
@@ -744,7 +744,7 @@
*/
static struct ChannelState *
create_channel_to_destination (struct DestinationChannel *dt,
- int client_af)
+ int client_af)
{
struct ChannelState *ts;
unsigned int apptype;
@@ -774,10 +774,10 @@
if (dt->destination->is_service)
{
ts->channel = GNUNET_CADET_channel_create (cadet_handle,
- ts,
-
&dt->destination->details.service_destination.target,
- apptype,
- GNUNET_CADET_OPTION_DEFAULT);
+ ts,
+
&dt->destination->details.service_destination.target,
+ apptype,
+ GNUNET_CADET_OPTION_DEFAULT);
if (NULL == ts->channel)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -803,7 +803,8 @@
GNUNET_TUN_ipv4toregexsearch
(&dt->destination->details.exit_destination.ip.v4,
dt->destination_port,
address);
- GNUNET_asprintf (&policy, "%s%s",
+ GNUNET_asprintf (&policy,
+ "%s%s",
GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX,
address);
break;
@@ -857,6 +858,36 @@
/**
+ * Output destination of a channel for diagnostics.
+ *
+ * @param de destination to process
+ * @return diagnostic string describing destination
+ */
+static const char *
+print_channel_destination (const struct DestinationEntry *de)
+{
+ static char dest[256];
+
+ if (de->is_service)
+ {
+ GNUNET_snprintf (dest,
+ sizeof (dest),
+ "HS: %s-%s\n",
+ GNUNET_i2s (&de->details.service_destination.target),
+ GNUNET_h2s
(&de->details.service_destination.service_descriptor));
+ }
+ else
+ {
+ inet_ntop (de->details.exit_destination.af,
+ &de->details.exit_destination.ip,
+ dest,
+ sizeof (dest));
+ }
+ return dest;
+}
+
+
+/**
* Route a packet via cadet to the given destination.
*
* @param destination description of the destination
@@ -1098,7 +1129,11 @@
if (NULL == ts->channel)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Packet dropped, channel not yet ready\n");
+ "Packet dropped, channel to %s not yet ready (%s)\n",
+ print_channel_destination (&ts->destination),
+ (NULL == ts->search)
+ ? "EXIT search failed"
+ : "EXIT search active");
GNUNET_STATISTICS_update (stats,
gettext_noop ("# Packets dropped (channel not yet
online)"),
1,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35781 - gnunet/src/vpn,
gnunet <=