From d569a22c73fc9a5a5ca99d328e7a24d2391413a3 Mon Sep 17 00:00:00 2001 From: Joel Cunningham Date: Tue, 2 Jan 2018 13:44:34 -0600 Subject: [PATCH] tcpip: ensure core is locked for init done function This ensures the core is locked when executing the init done function passed to tcpip_init The could manifest as a synchronization issue during early init if another thread was in the LwIP context at the same time --- src/api/tcpip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/tcpip.c b/src/api/tcpip.c index 608ba607..c192a0fb 100644 --- a/src/api/tcpip.c +++ b/src/api/tcpip.c @@ -93,11 +93,11 @@ tcpip_thread(void *arg) LWIP_MARK_TCPIP_THREAD(); + LOCK_TCPIP_CORE(); if (tcpip_init_done != NULL) { tcpip_init_done(tcpip_init_done_arg); } - LOCK_TCPIP_CORE(); while (1) { /* MAIN Loop */ LWIP_TCPIP_THREAD_ALIVE(); /* wait for a message, timeouts are processed while waiting */