diff options
Diffstat (limited to 'src/mesh/mesh_api.c')
-rw-r--r-- | src/mesh/mesh_api.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index 9991f1243..d3dad49a4 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c | |||
@@ -281,6 +281,8 @@ struct GNUNET_MESH_Tunnel | |||
281 | */ | 281 | */ |
282 | GNUNET_PEER_Id peer; | 282 | GNUNET_PEER_Id peer; |
283 | 283 | ||
284 | struct GNUNET_PeerIdentity pid; | ||
285 | |||
284 | /** | 286 | /** |
285 | * Any data the caller wants to put in here | 287 | * Any data the caller wants to put in here |
286 | */ | 288 | */ |
@@ -731,6 +733,7 @@ do_reconnect (struct GNUNET_MESH_Handle *h) | |||
731 | tmsg.header.size = htons (sizeof (struct GNUNET_MESH_TunnelMessage)); | 733 | tmsg.header.size = htons (sizeof (struct GNUNET_MESH_TunnelMessage)); |
732 | tmsg.tunnel_id = htonl (t->tid); | 734 | tmsg.tunnel_id = htonl (t->tid); |
733 | tmsg.port = htonl (t->port); | 735 | tmsg.port = htonl (t->port); |
736 | t->pid = tmsg.peer; | ||
734 | GNUNET_PEER_resolve (t->peer, &tmsg.peer); | 737 | GNUNET_PEER_resolve (t->peer, &tmsg.peer); |
735 | 738 | ||
736 | options = 0; | 739 | options = 0; |
@@ -814,6 +817,7 @@ process_tunnel_created (struct GNUNET_MESH_Handle *h, | |||
814 | t = create_tunnel (h, tid); | 817 | t = create_tunnel (h, tid); |
815 | t->allow_send = GNUNET_NO; | 818 | t->allow_send = GNUNET_NO; |
816 | t->peer = GNUNET_PEER_intern (&msg->peer); | 819 | t->peer = GNUNET_PEER_intern (&msg->peer); |
820 | t->pid = msg->peer; | ||
817 | t->mesh = h; | 821 | t->mesh = h; |
818 | t->tid = tid; | 822 | t->tid = tid; |
819 | t->port = port; | 823 | t->port = port; |
@@ -1455,6 +1459,7 @@ GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h, | |||
1455 | LOG (GNUNET_ERROR_TYPE_DEBUG, " number %X\n", t->tid); | 1459 | LOG (GNUNET_ERROR_TYPE_DEBUG, " number %X\n", t->tid); |
1456 | t->ctx = tunnel_ctx; | 1460 | t->ctx = tunnel_ctx; |
1457 | t->peer = GNUNET_PEER_intern (peer); | 1461 | t->peer = GNUNET_PEER_intern (peer); |
1462 | t->pid = *peer; | ||
1458 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_CREATE); | 1463 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_CREATE); |
1459 | msg.header.size = htons (sizeof (struct GNUNET_MESH_TunnelMessage)); | 1464 | msg.header.size = htons (sizeof (struct GNUNET_MESH_TunnelMessage)); |
1460 | msg.tunnel_id = htonl (t->tid); | 1465 | msg.tunnel_id = htonl (t->tid); |
@@ -1538,7 +1543,7 @@ GNUNET_MESH_tunnel_get_info (struct GNUNET_MESH_Tunnel *tunnel, | |||
1538 | ret = (const union GNUNET_MESH_TunnelInfo *) &tunnel->ooorder; | 1543 | ret = (const union GNUNET_MESH_TunnelInfo *) &tunnel->ooorder; |
1539 | break; | 1544 | break; |
1540 | case GNUNET_MESH_OPTION_PEER: | 1545 | case GNUNET_MESH_OPTION_PEER: |
1541 | ret = (const union GNUNET_MESH_TunnelInfo *) &tunnel->peer; | 1546 | ret = (const union GNUNET_MESH_TunnelInfo *) &tunnel->pid; |
1542 | break; | 1547 | break; |
1543 | default: | 1548 | default: |
1544 | GNUNET_break (0); | 1549 | GNUNET_break (0); |