From de020c71e2ea9a78ad5fa2d0a6649c7bc3a86423 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Sat, 18 Aug 2012 13:12:14 +0000 Subject: - fixes, eliminate malformed data assert --- src/mesh/gnunet-service-mesh.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index bde1a5cf4..4ce491a1f 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -6886,7 +6886,8 @@ handle_local_to_origin (void *cls, struct GNUNET_SERVER_Client *client, GNUNET_break (0); GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "To Origin PID, expected %u, got %u\n", - clinfo->bck_pid + 1, ntohl (data_msg->pid)); + clinfo->bck_pid + 1, + ntohl (data_msg->pid)); GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); return; } @@ -6894,6 +6895,7 @@ handle_local_to_origin (void *cls, struct GNUNET_SERVER_Client *client, /* Ok, everything is correct, send the message * (pretend we got it from a mesh peer) */ + clinfo->bck_pid++; { char buf[ntohs (message->size)] GNUNET_ALIGN; struct GNUNET_MESH_ToOrigin *copy; @@ -6904,7 +6906,16 @@ handle_local_to_origin (void *cls, struct GNUNET_SERVER_Client *client, GNUNET_PEER_resolve (t->id.oid, ©->oid); copy->tid = htonl (t->id.tid); copy->ttl = htonl (default_ttl); - GNUNET_assert (ntohl (copy->pid) == (t->bck_pid + 1)); + if (ntohl (copy->pid) != (t->bck_pid + 1)) + { + GNUNET_break (0); + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "To Origin PID, expected %u, got %u\n", + t->bck_pid + 1, + ntohl (copy->pid)); + return; + } + t->bck_pid++; copy->sender = my_full_id; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " calling generic handler...\n"); -- cgit v1.2.3