From: Christian Grothoff Date: Wed, 15 Feb 2017 16:49:59 +0000 (+0100) Subject: fix #4895: set highbit always for the returned cn, not just on the second call X-Git-Tag: taler-0.2.1~175 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7795e79543c6828b34977e35a10f5325beae55c7;p=oweals%2Fgnunet.git fix #4895: set highbit always for the returned cn, not just on the second call --- 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; }