aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-08-05 09:55:31 +0000
committerBart Polot <bart@net.in.tum.de>2013-08-05 09:55:31 +0000
commite43871e4be243e6c8e26d0c5ecd51054820570bd (patch)
treedf7e2e7d5ca2a37be5e94b66d5b0f1620a4e8771 /src
parente90e2010b849db56dd53922e8c8262192582459c (diff)
downloadgnunet-e43871e4be243e6c8e26d0c5ecd51054820570bd.tar.gz
gnunet-e43871e4be243e6c8e26d0c5ecd51054820570bd.zip
- fixes
Diffstat (limited to 'src')
-rw-r--r--src/mesh/gnunet-service-mesh-enc.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/mesh/gnunet-service-mesh-enc.c b/src/mesh/gnunet-service-mesh-enc.c
index f239c0021..671e580fb 100644
--- a/src/mesh/gnunet-service-mesh-enc.c
+++ b/src/mesh/gnunet-service-mesh-enc.c
@@ -4728,9 +4728,10 @@ handle_mesh_encrypted (const struct GNUNET_PeerIdentity *peer,
4728 const struct GNUNET_MESH_Encrypted *msg, 4728 const struct GNUNET_MESH_Encrypted *msg,
4729 int fwd) 4729 int fwd)
4730{ 4730{
4731 struct MeshTunnel2 *t;
4732 struct MeshConnection *c; 4731 struct MeshConnection *c;
4733 GNUNET_PEER_Id hop; 4732 struct MeshTunnel2 *t;
4733 struct MeshPeer *neighbor;
4734 strcut MeshFlowControl *fc;
4734 uint32_t pid; 4735 uint32_t pid;
4735 uint32_t ttl; 4736 uint32_t ttl;
4736 uint16_t type; 4737 uint16_t type;
@@ -4759,7 +4760,16 @@ handle_mesh_encrypted (const struct GNUNET_PeerIdentity *peer,
4759 } 4760 }
4760 t = c->t; 4761 t = c->t;
4761 4762
4762 /* Initialize FWD/BCK data */ 4763 /* Check neighbor status */
4764 neighbor = peer_get (peer);
4765 fc = neighbor->fc;
4766 if (NULL == fc)
4767 {
4768 GNUNET_break (0);
4769 return GNUNET_OK;
4770 }
4771
4772 /* Check PID */
4763 pid = ntohl (msg->pid); 4773 pid = ntohl (msg->pid);
4764 if (GMC_is_pid_bigger (pid, fc->last_ack_sent)) 4774 if (GMC_is_pid_bigger (pid, fc->last_ack_sent))
4765 { 4775 {
@@ -4769,10 +4779,12 @@ handle_mesh_encrypted (const struct GNUNET_PeerIdentity *peer,
4769 pid, fc->last_pid_recv, fc->last_ack_sent); 4779 pid, fc->last_pid_recv, fc->last_ack_sent);
4770 return GNUNET_OK; 4780 return GNUNET_OK;
4771 } 4781 }
4772 if (NULL != c) 4782 if (MESH_CONNECTION_SENT == c->state)
4773 tunnel_change_state (t, MESH_TUNNEL_READY); 4783 connection_change_state (c, MESH_CONNECTION_READY);
4774 tunnel_reset_timeout (t, fwd); 4784 connection_reset_timeout (c, fwd);
4775 if (NULL != c) 4785
4786 /* Is this message for us? */
4787 if (NULL != c->t->channel_head)
4776 { 4788 {
4777 /* TODO signature verification */ 4789 /* TODO signature verification */
4778 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " it's for us! sending to client\n"); 4790 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " it's for us! sending to client\n");