summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2019-02-28 19:06:22 +0100
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2019-02-28 19:06:22 +0100
commitfaf5ac19261f7e3875deac5fdcd773c41dd048e2 (patch)
tree4de9eb74e0a9a590fd73cf26a26bbdd0a0344ea6
parent901aca403fa1c1b6c9fce2c89acf5d6b8b278268 (diff)
prevent unordered message delivery
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index 1746fc509..3c83d0bb3 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -1331,7 +1331,10 @@ GCCH_handle_channel_plaintext_data (struct CadetChannel *ch,
ccc->client_ready = GNUNET_NO;
GSC_send_to_client (ccc->c,
env);
- ch->mid_recv.mid = htonl (1 + ntohl (ch->mid_recv.mid));
+ if (GNUNET_NO == ch->out_of_order)
+ ch->mid_recv.mid = htonl (1 + ntohl (msg->mid.mid));
+ else
+ ch->mid_recv.mid = htonl (1 + ntohl (ch->mid_recv.mid));
ch->mid_futures >>= 1;
if ( (GNUNET_YES == ch->out_of_order) &&
(GNUNET_NO == ch->reliable) )