mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 05:12:57 +01:00
Merge pull request #16338 from haukepetersen/fix_nimble_tmpfixrandseed
pkg/nimble: temporary fix to NimBLE PRNG seed issue
This commit is contained in:
commit
922611b224
@ -50,6 +50,7 @@
|
||||
#if defined(CPU_FAM_NRF52) || defined(CPU_FAM_NRF51)
|
||||
#include "nrf_clock.h"
|
||||
#endif
|
||||
#include "controller/ble_ll.h"
|
||||
|
||||
static char _stack_controller[NIMBLE_CONTROLLER_STACKSIZE];
|
||||
#endif
|
||||
@ -81,6 +82,15 @@ static void *_host_thread(void *arg)
|
||||
THREAD_CREATE_STACKTEST,
|
||||
(thread_task_func_t)nimble_port_ll_task_func, NULL,
|
||||
"nimble_ctrl");
|
||||
|
||||
/* XXX: seeding of the used PRNG is done when this function is called the
|
||||
* first time. However, this could potentially be in interrupt context,
|
||||
* leading to an malloc call in that context, breaking with the used
|
||||
* thread safe malloc wrapper in RIOT. So we better do this seeding in
|
||||
* a deterministic fashion right here.
|
||||
* -> this fix is temporary until a proper fix is merged to NimBLE
|
||||
* upstream */
|
||||
ble_ll_rand();
|
||||
#endif
|
||||
|
||||
nimble_port_run();
|
||||
|
Loading…
Reference in New Issue
Block a user