[riot-notifications] [RIOT-OS/RIOT] net/gnrc_lorawan: fix random_uint32_range upper bound (#16664)

José Alamos notifications at github.com
Mon Aug 2 10:24:08 CEST 2021

@jia200x commented on this pull request.

> @@ -100,7 +100,7 @@ uint32_t gnrc_lorawan_pick_channel(gnrc_lorawan_t *mac)
     uint8_t index = 0;
-    uint8_t random_number = random_uint32_range(0, bitarithm_bits_set(mac->channel_mask));
+    uint8_t random_number = random_uint32_range(0, bitarithm_bits_set(mac->channel_mask) + 1);

ah no... I think the addition should be placed outside of the function

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210802/561e5675/attachment-0001.htm>

More information about the notifications mailing list