diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-08-18 13:12:14 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-08-18 13:12:14 +0000 |
commit | de020c71e2ea9a78ad5fa2d0a6649c7bc3a86423 (patch) | |
tree | f6704de38047a297e6ed3017d8da41038adfcf4f | |
parent | a35674b790d3774ae8e901e8f07ae33f16a1bec4 (diff) |
- fixes, eliminate malformed data assert
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 15 |
1 files 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"); |