From be3c1d4fd439562d75b2496e26ae1bb48eb81b01 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Thu, 7 Nov 2013 13:00:38 +0000 Subject: [PATCH] - fix loopback channel create --- src/mesh/gnunet-service-mesh_tunnel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c index c80dc3614..7fbcd7081 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.c +++ b/src/mesh/gnunet-service-mesh_tunnel.c @@ -544,7 +544,7 @@ send_kx (struct MeshTunnel3 *t, LOG (GNUNET_ERROR_TYPE_DEBUG, "GMT KX on Tunnel %s\n", GMT_2s (t)); /* Avoid loopback. */ - if (myid == GMP_get_short_id (t->peer)) + if (GMT_is_loopback (t)) { LOG (GNUNET_ERROR_TYPE_DEBUG, " loopback!\n"); GNUNET_break (0); @@ -865,7 +865,7 @@ handle_ch_create (struct MeshTunnel3 *t, /* Check channel */ ch = GMT_get_channel (t, ntohl (msg->chid)); - if (NULL != ch) + if (NULL != ch && ! GMT_is_loopback (t)) { /* Probably a retransmission, safe to ignore */ LOG (GNUNET_ERROR_TYPE_DEBUG, " already exists...\n"); @@ -1845,7 +1845,7 @@ GMT_send_prebuilt_message (const struct GNUNET_MessageHeader *message, } LOG (GNUNET_ERROR_TYPE_DEBUG, "GMT Send on Tunnel %s\n", GMT_2s (t)); - if (myid == GMP_get_short_id (t->peer)) + if (GMT_is_loopback (t)) { LOG (GNUNET_ERROR_TYPE_DEBUG, " loopback!\n"); handle_decrypted (t, message, fwd); @@ -1894,7 +1894,7 @@ GMT_send_prebuilt_message (const struct GNUNET_MessageHeader *message, int GMT_is_loopback (const struct MeshTunnel3 *t) { - return (myid == GMP_get_short_id(t->peer)); + return (myid == GMP_get_short_id (t->peer)); } -- 2.25.1