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 /src/mesh/gnunet-service-mesh.c | |
parent | a35674b790d3774ae8e901e8f07ae33f16a1bec4 (diff) | |
download | gnunet-de020c71e2ea9a78ad5fa2d0a6649c7bc3a86423.tar.gz gnunet-de020c71e2ea9a78ad5fa2d0a6649c7bc3a86423.zip |
- fixes, eliminate malformed data assert
Diffstat (limited to 'src/mesh/gnunet-service-mesh.c')
-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, | |||
6886 | GNUNET_break (0); | 6886 | GNUNET_break (0); |
6887 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 6887 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
6888 | "To Origin PID, expected %u, got %u\n", | 6888 | "To Origin PID, expected %u, got %u\n", |
6889 | clinfo->bck_pid + 1, ntohl (data_msg->pid)); | 6889 | clinfo->bck_pid + 1, |
6890 | ntohl (data_msg->pid)); | ||
6890 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 6891 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
6891 | return; | 6892 | return; |
6892 | } | 6893 | } |
@@ -6894,6 +6895,7 @@ handle_local_to_origin (void *cls, struct GNUNET_SERVER_Client *client, | |||
6894 | /* Ok, everything is correct, send the message | 6895 | /* Ok, everything is correct, send the message |
6895 | * (pretend we got it from a mesh peer) | 6896 | * (pretend we got it from a mesh peer) |
6896 | */ | 6897 | */ |
6898 | clinfo->bck_pid++; | ||
6897 | { | 6899 | { |
6898 | char buf[ntohs (message->size)] GNUNET_ALIGN; | 6900 | char buf[ntohs (message->size)] GNUNET_ALIGN; |
6899 | struct GNUNET_MESH_ToOrigin *copy; | 6901 | struct GNUNET_MESH_ToOrigin *copy; |
@@ -6904,7 +6906,16 @@ handle_local_to_origin (void *cls, struct GNUNET_SERVER_Client *client, | |||
6904 | GNUNET_PEER_resolve (t->id.oid, ©->oid); | 6906 | GNUNET_PEER_resolve (t->id.oid, ©->oid); |
6905 | copy->tid = htonl (t->id.tid); | 6907 | copy->tid = htonl (t->id.tid); |
6906 | copy->ttl = htonl (default_ttl); | 6908 | copy->ttl = htonl (default_ttl); |
6907 | GNUNET_assert (ntohl (copy->pid) == (t->bck_pid + 1)); | 6909 | if (ntohl (copy->pid) != (t->bck_pid + 1)) |
6910 | { | ||
6911 | GNUNET_break (0); | ||
6912 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
6913 | "To Origin PID, expected %u, got %u\n", | ||
6914 | t->bck_pid + 1, | ||
6915 | ntohl (copy->pid)); | ||
6916 | return; | ||
6917 | } | ||
6918 | t->bck_pid++; | ||
6908 | copy->sender = my_full_id; | 6919 | copy->sender = my_full_id; |
6909 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 6920 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
6910 | " calling generic handler...\n"); | 6921 | " calling generic handler...\n"); |