diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-10-27 01:05:23 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-10-27 01:05:23 +0000 |
commit | a5777dcaa4cd80af1f0a25475e74feec41793218 (patch) | |
tree | 76dfeb1a95ec4058757f7160e76b7e1de9d7f17b | |
parent | 8011a0ed49033321c4551d64e299b9d41b40ebc3 (diff) | |
download | gnunet-a5777dcaa4cd80af1f0a25475e74feec41793218.tar.gz gnunet-a5777dcaa4cd80af1f0a25475e74feec41793218.zip |
Fixed #1856, added extra check for tunnel local numbering
-rw-r--r-- | src/mesh/mesh_api_new.c | 10 |
1 files changed, 9 insertions, 1 deletions
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) | |||
683 | struct GNUNET_MESH_TunnelMessage tmsg; | 683 | struct GNUNET_MESH_TunnelMessage tmsg; |
684 | struct GNUNET_MESH_PeerControl pmsg; | 684 | struct GNUNET_MESH_PeerControl pmsg; |
685 | 685 | ||
686 | if (t->tid >= GNUNET_MESH_LOCAL_TUNNEL_ID_SERV) | ||
687 | { | ||
688 | /* Tunnel was created by service (incoming tunnel) */ | ||
689 | /* TODO: Notify service of missing tunnel, to request | ||
690 | * creator to recreate path (find a path to him via DHT?) | ||
691 | */ | ||
692 | continue; | ||
693 | } | ||
686 | tmsg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_CREATE); | 694 | tmsg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_CREATE); |
687 | tmsg.header.size = htons (sizeof (struct GNUNET_MESH_TunnelMessage)); | 695 | tmsg.header.size = htons (sizeof (struct GNUNET_MESH_TunnelMessage)); |
688 | tmsg.tunnel_id = htonl (t->tid); | 696 | tmsg.tunnel_id = htonl (t->tid); |
@@ -753,7 +761,7 @@ process_tunnel_created (struct GNUNET_MESH_Handle *h, | |||
753 | MESH_TunnelNumber tid; | 761 | MESH_TunnelNumber tid; |
754 | 762 | ||
755 | tid = ntohl (msg->tunnel_id); | 763 | tid = ntohl (msg->tunnel_id); |
756 | if (tid <= GNUNET_MESH_LOCAL_TUNNEL_ID_CLI) | 764 | if (tid < GNUNET_MESH_LOCAL_TUNNEL_ID_SERV) |
757 | { | 765 | { |
758 | GNUNET_break (0); | 766 | GNUNET_break (0); |
759 | return; | 767 | return; |