Yes, that's true.
The dhcp_discover function (which calls dhcp_create_msg) is being called from the tcp_ip main loop thread and the input processing function is on another thread which will call dhcp_select (that calls dhcp_create_msg as well). Therefore in summary, dhcp_create_msg is being called from 1) dhcp_discover (because of dhcp timers and from tcpip_thread) and 2) from dhcp_select due to an input packet with the following stack call: my_driver_input_packet_callback->ethernet_if_input->ip_input->udp_input->dhcp_recv->dhcp_handle_offer->dhcp_select->dhcp_create_msg.
So this is the problem, but I don't know how to solve it, because tcp_init function create a new thread and my input buffer are coming from another thread. Could you please tell me how to handle this situation? I tried LWIP_TCPIP_CORE_LOCKING but did not help.
Thanks,