michal-narajowski commented on a change in pull request #7: nimble/mesh: Fix 
segmentation fault when running on simulator
URL: https://github.com/apache/mynewt-nimble/pull/7#discussion_r175078626
 
 

 ##########
 File path: nimble/host/mesh/src/shell.c
 ##########
 @@ -566,18 +566,24 @@ struct shell_cmd_help cmd_lpn_help = {
 
 #endif /* MESH_LOW_POWER */
 
-static int check_addr_unassigned(uint8_t addr[BLE_DEV_ADDR_LEN])
+static int check_pub_addr_unassigned(void)
 {
-       return memcmp(addr, (uint8_t[BLE_DEV_ADDR_LEN]){0, 0, 0, 0, 0, 0},
-                       BLE_DEV_ADDR_LEN) == 0;
+#ifdef ARCH_sim
+       return 0;
+#else
+       uint8_t zero_addr[BLE_DEV_ADDR_LEN] = { 0 };
+
+       return memcmp(MYNEWT_VAL(BLE_PUBLIC_DEV_ADDR),
+                                 zero_addr, BLE_DEV_ADDR_LEN) == 0;
 
 Review comment:
   whitespace

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to