[socket] Hold lwip lock for entire write() operation

Same pattern as writev — write() calls internal_write_() then
internal_output_(), each acquiring the lock separately. Hold
the lock at the outer scope so inner calls just bump the
recursion counter.
This commit is contained in:
J. Nick Koston
2026-03-10 00:57:36 -10:00
parent cc05bf3ed2
commit 81d12fd14a
@@ -616,6 +616,7 @@ int LWIPRawImpl::internal_output_() {
}
ssize_t LWIPRawImpl::write(const void *buf, size_t len) {
LWIP_LOCK(); // Hold for write + optional output
ssize_t written = this->internal_write_(buf, len);
if (written == -1)
return -1;