diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-02-15 17:49:59 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-02-15 17:49:59 +0100 |
commit | 7795e79543c6828b34977e35a10f5325beae55c7 (patch) | |
tree | 16a127846bddf727fd4399771ea38573073640ca /src/cadet | |
parent | 60790f6e89914decc21c850d07aef9be237a6c41 (diff) | |
download | gnunet-7795e79543c6828b34977e35a10f5325beae55c7.tar.gz gnunet-7795e79543c6828b34977e35a10f5325beae55c7.zip |
fix #4895: set highbit always for the returned cn, not just on the second call
Diffstat (limited to 'src/cadet')
-rw-r--r-- | src/cadet/gnunet-service-cadet-new_tunnels.c | 8 |
1 files 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) | |||
1888 | ctn = ntohl (t->next_ctn.cn); | 1888 | ctn = ntohl (t->next_ctn.cn); |
1889 | while (NULL != | 1889 | while (NULL != |
1890 | GNUNET_CONTAINER_multihashmap32_get (t->channels, | 1890 | GNUNET_CONTAINER_multihashmap32_get (t->channels, |
1891 | ctn)) | 1891 | ctn | highbit)) |
1892 | { | 1892 | { |
1893 | ctn = ((ctn + 1) & (~ HIGH_BIT)) | highbit; | 1893 | ctn = ((ctn + 1) & (~ HIGH_BIT)); |
1894 | } | 1894 | } |
1895 | t->next_ctn.cn = htonl (((ctn + 1) & (~ HIGH_BIT)) | highbit); | 1895 | t->next_ctn.cn = htonl ((ctn + 1) & (~ HIGH_BIT)); |
1896 | ret.cn = htonl (ctn); | 1896 | ret.cn = htonl (ctn | highbit); |
1897 | return ret; | 1897 | return ret; |
1898 | } | 1898 | } |
1899 | 1899 | ||