From 7795e79543c6828b34977e35a10f5325beae55c7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 15 Feb 2017 17:49:59 +0100 Subject: [PATCH] fix #4895: set highbit always for the returned cn, not just on the second call --- src/cadet/gnunet-service-cadet-new_tunnels.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cadet/gnunet-service-cadet-new_tunnels.c b/src/cadet/gnunet-service-cadet-new_tunnels.c index 1b7e4d9d3..5b3abde57 100644 --- a/src/cadet/gnunet-service-cadet-new_tunnels.c +++ b/src/cadet/gnunet-service-cadet-new_tunnels.c @@ -1888,12 +1888,12 @@ get_next_free_ctn (struct CadetTunnel *t) ctn = ntohl (t->next_ctn.cn); while (NULL != GNUNET_CONTAINER_multihashmap32_get (t->channels, - ctn)) + ctn | highbit)) { - ctn = ((ctn + 1) & (~ HIGH_BIT)) | highbit; + ctn = ((ctn + 1) & (~ HIGH_BIT)); } - t->next_ctn.cn = htonl (((ctn + 1) & (~ HIGH_BIT)) | highbit); - ret.cn = htonl (ctn); + t->next_ctn.cn = htonl ((ctn + 1) & (~ HIGH_BIT)); + ret.cn = htonl (ctn | highbit); return ret; } -- 2.25.1