You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/09/01 10:16:13 UTC

[GitHub] [mynewt-nimble] haukepetersen commented on a change in pull request #856: controller: properly seed srand() during initialization

haukepetersen commented on a change in pull request #856:
URL: https://github.com/apache/mynewt-nimble/pull/856#discussion_r481031056



##########
File path: nimble/controller/src/ble_ll.c
##########
@@ -1682,15 +1663,17 @@ ble_ll_init(void)
     features |= BLE_LL_FEAT_ISO_HOST_SUPPORT;
 #endif
 
+    lldata->ll_supp_features = features;
+
     /* Initialize random number generation */
     ble_ll_rand_init();
-
-    /* XXX: This really doesn't belong here, as the address probably has not
-     * been set yet.
-     */
-    ble_ll_seed_prng();
-
-    lldata->ll_supp_features = features;
+    /* Start the random number generator */
+    ble_ll_rand_start();
+    /* Use the random number generator to seed the STDLIBs pseudo-number
+     * generator */
+    unsigned seed;

Review comment:
       done




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org