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; 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) { }