From f348325dbd3bc02acaee8d06c14b8711d7368637 Mon Sep 17 00:00:00 2001 From: Arto Kinnunen Date: Tue, 26 Mar 2019 12:54:59 +0200 Subject: [PATCH 1/2] Squashed 'features/nanostack/coap-service/' changes from 227cc3d..086e7ba 086e7ba Adjust variable scope (#121) git-subtree-dir: features/nanostack/coap-service git-subtree-split: 086e7ba8a1afdcfe3df16ae92ef28cae1af5a4a6 --- .../nanostack/coap-service/source/coap_connection_handler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/features/nanostack/coap-service/source/coap_connection_handler.c b/features/nanostack/coap-service/source/coap_connection_handler.c index 0942dc8e21..fe4bbbde1a 100644 --- a/features/nanostack/coap-service/source/coap_connection_handler.c +++ b/features/nanostack/coap-service/source/coap_connection_handler.c @@ -408,8 +408,9 @@ static int send_to_real_socket(int8_t socket_id, const ns_address_t *address, co .msg_iovlen = 1 }; + uint8_t ancillary_databuffer[NS_CMSG_SPACE(sizeof(ns_in6_pktinfo_t))]; + if (memcmp(source_address, ns_in6addr_any, 16)) { - uint8_t ancillary_databuffer[NS_CMSG_SPACE(sizeof(ns_in6_pktinfo_t))]; ns_cmsghdr_t *cmsg; ns_in6_pktinfo_t *pktinfo; From adedd0513929acb50482c1a5065f6b977b43ad91 Mon Sep 17 00:00:00 2001 From: Arto Kinnunen Date: Tue, 26 Mar 2019 12:51:08 +0200 Subject: [PATCH 2/2] Fix compiler warnings in Nanostack HAL Fix compiler warnings: -"warning: 'size' argument to memset is '0'" -"warning: implicit declaration of function" --- .../nanostack-hal-mbed-cmsis-rtos/arm_hal_fhss_timer.cpp | 4 +++- .../nanostack-hal-mbed-cmsis-rtos/arm_hal_random.c | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_fhss_timer.cpp b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_fhss_timer.cpp index 3c0f61aaa7..81e4f7ee76 100644 --- a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_fhss_timer.cpp +++ b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_fhss_timer.cpp @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #include "ns_types.h" #include "fhss_api.h" #include "fhss_config.h" @@ -70,7 +71,7 @@ static fhss_timeout_s *allocate_timeout(void) { for (int i = 0; i < NUMBER_OF_SIMULTANEOUS_TIMEOUTS; i++) { if (fhss_timeout[i].fhss_timer_callback == NULL) { - memset(&fhss_timeout[i], sizeof(fhss_timeout_s), 0); + memset(&fhss_timeout[i], 0, sizeof(fhss_timeout_s)); return &fhss_timeout[i]; } } @@ -170,3 +171,4 @@ fhss_timer_t fhss_functions = { .fhss_get_timestamp = platform_fhss_timestamp_read, .fhss_resolution_divider = 1 }; + diff --git a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_random.c b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_random.c index 804f1485ab..773a2b70d3 100644 --- a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_random.c +++ b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_random.c @@ -19,6 +19,12 @@ #include "mbedtls/entropy_poll.h" +#ifdef MBEDTLS_ENTROPY_HARDWARE_ALT +#if defined(MBEDTLS_PLATFORM_C) +#include "mbedtls/platform.h" +#endif +#endif + void arm_random_module_init(void) { }