diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-11-27 04:28:33 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-11-27 04:28:33 +0000 |
commit | 3b997bba84a8a11ae5b85c1f23e5f94a1139f7e4 (patch) | |
tree | 1711c6db0e9e3d6458f13ded45114fa2fec64a80 | |
parent | 1e5f21da1cb58795b034f54ebe2c2d0b8ebf10e5 (diff) | |
download | gnunet-3b997bba84a8a11ae5b85c1f23e5f94a1139f7e4.tar.gz gnunet-3b997bba84a8a11ae5b85c1f23e5f94a1139f7e4.zip |
- fix case of reconnection during valid handshake
-rw-r--r-- | src/mesh/gnunet-service-mesh_tunnel.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c index 56b27147e..baf39dfd1 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.c +++ b/src/mesh/gnunet-service-mesh_tunnel.c | |||
@@ -1528,11 +1528,19 @@ GMT_change_cstate (struct MeshTunnel3* t, enum MeshTunnel3CState state) | |||
1528 | GMP_2s (t->peer), cstate2s (state)); | 1528 | GMP_2s (t->peer), cstate2s (state)); |
1529 | if (myid != GMP_get_short_id (t->peer) && | 1529 | if (myid != GMP_get_short_id (t->peer) && |
1530 | MESH_TUNNEL3_READY != t->cstate && | 1530 | MESH_TUNNEL3_READY != t->cstate && |
1531 | MESH_TUNNEL3_READY == state && | 1531 | MESH_TUNNEL3_READY == state) |
1532 | MESH_TUNNEL3_KEY_UNINITIALIZED == t->estate) | ||
1533 | { | 1532 | { |
1534 | LOG (GNUNET_ERROR_TYPE_DEBUG, " triggered rekey\n"); | 1533 | t->cstate = state; |
1535 | rekey_tunnel (t, NULL); | 1534 | if (MESH_TUNNEL3_KEY_OK == t->estate) |
1535 | { | ||
1536 | LOG (GNUNET_ERROR_TYPE_DEBUG, " triggered send queued data\n"); | ||
1537 | send_queued_data (t); | ||
1538 | } | ||
1539 | else if (MESH_TUNNEL3_KEY_UNINITIALIZED == t->estate) | ||
1540 | { | ||
1541 | LOG (GNUNET_ERROR_TYPE_DEBUG, " triggered rekey\n"); | ||
1542 | rekey_tunnel (t, NULL); | ||
1543 | } | ||
1536 | } | 1544 | } |
1537 | t->cstate = state; | 1545 | t->cstate = state; |
1538 | 1546 | ||
@@ -1710,6 +1718,7 @@ GMT_destroy_empty (struct MeshTunnel3 *t) | |||
1710 | GMC_send_destroy (iter->c); | 1718 | GMC_send_destroy (iter->c); |
1711 | } | 1719 | } |
1712 | 1720 | ||
1721 | t->cstate = MESH_TUNNEL3_NEW; | ||
1713 | t->destroy = GNUNET_YES; | 1722 | t->destroy = GNUNET_YES; |
1714 | } | 1723 | } |
1715 | 1724 | ||