From a5777dcaa4cd80af1f0a25475e74feec41793218 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Thu, 27 Oct 2011 01:05:23 +0000 Subject: [PATCH] Fixed #1856, added extra check for tunnel local numbering --- src/mesh/mesh_api_new.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mesh/mesh_api_new.c b/src/mesh/mesh_api_new.c index 64f880e06..bfdd902b7 100644 --- a/src/mesh/mesh_api_new.c +++ b/src/mesh/mesh_api_new.c @@ -683,6 +683,14 @@ reconnect (struct GNUNET_MESH_Handle *h) struct GNUNET_MESH_TunnelMessage tmsg; struct GNUNET_MESH_PeerControl pmsg; + if (t->tid >= GNUNET_MESH_LOCAL_TUNNEL_ID_SERV) + { + /* Tunnel was created by service (incoming tunnel) */ + /* TODO: Notify service of missing tunnel, to request + * creator to recreate path (find a path to him via DHT?) + */ + continue; + } tmsg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_CREATE); tmsg.header.size = htons (sizeof (struct GNUNET_MESH_TunnelMessage)); tmsg.tunnel_id = htonl (t->tid); @@ -753,7 +761,7 @@ process_tunnel_created (struct GNUNET_MESH_Handle *h, MESH_TunnelNumber tid; tid = ntohl (msg->tunnel_id); - if (tid <= GNUNET_MESH_LOCAL_TUNNEL_ID_CLI) + if (tid < GNUNET_MESH_LOCAL_TUNNEL_ID_SERV) { GNUNET_break (0); return; -- 2.25.1