static struct MeshTunnel *
tunnel_get_by_local_id (struct MeshClient *c, MESH_TunnelNumber tid)
{
+ if (0 == (tid & GNUNET_MESH_LOCAL_TUNNEL_ID_CLI))
+ {
+ GNUNET_break_op (0);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TID %X not a local tid\n", tid);
+ return NULL;
+ }
if (tid >= GNUNET_MESH_LOCAL_TUNNEL_ID_SERV)
{
return tunnel_get_incoming (tid);
}
else
{
- GNUNET_assert (tid >= GNUNET_MESH_LOCAL_TUNNEL_ID_CLI);
return GNUNET_CONTAINER_multihashmap32_get (c->own_tunnels, tid);
}
}
t->owner = client;
fc_init (&t->next_fc);
fc_init (&t->prev_fc);
- t->next_fc->t = t;
- t->prev_fc->t = t;
+ t->next_fc.t = t;
+ t->prev_fc.t = t;
t->local_tid = local;
n_tunnels++;
GNUNET_STATISTICS_update (stats, "# tunnels", 1, GNUNET_NO);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"* %s starting poll timeout\n",
GNUNET_i2s (&my_full_id));
- fc->t = t;
fc->poll_task = GNUNET_SCHEDULER_add_delayed (fc->poll_time,
&tunnel_poll, fc);
}
t_msg = (struct GNUNET_MESH_TunnelMessage *) message;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " towards %s\n",
GNUNET_i2s (&t_msg->peer));
- /* Sanity check for tunnel numbering */
tid = ntohl (t_msg->tunnel_id);
- if (0 == (tid & GNUNET_MESH_LOCAL_TUNNEL_ID_CLI))
- {
- GNUNET_break (0);
- GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
- return;
- }
/* Sanity check for duplicate tunnel IDs */
if (NULL != tunnel_get_by_local_id (c, tid))
{
/* Tunnel exists? */
tid = ntohl (data_msg->tid);
- if (tid < GNUNET_MESH_LOCAL_TUNNEL_ID_CLI)
- {
- GNUNET_break (0);
- GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
- return;
- }
t = tunnel_get_by_local_id (c, tid);
if (NULL == t)
{