Index: devel/libuv/files/patch-src_unix_udp.c =================================================================== --- devel/libuv/files/patch-src_unix_udp.c (nonexistent) +++ devel/libuv/files/patch-src_unix_udp.c (working copy) @@ -0,0 +1,31 @@ +--- src/unix/udp.c.orig 2020-04-15 16:31:21 UTC ++++ src/unix/udp.c +@@ -214,11 +214,14 @@ static int uv__udp_recvmmsg(uv_udp_t* handle, uv_buf_t + else + handle->recv_cb(handle, UV__ERR(errno), buf, NULL, 0); + } else { +- /* pass each chunk to the application */ +- for (k = 0; k < (size_t) nread && handle->recv_cb != NULL; k++) { +- flags = UV_UDP_MMSG_CHUNK; ++ /* count to zero, so the buffer base comes last */ ++ for (k = nread; k > 0 && handle->recv_cb != NULL;) { ++ k--; ++ flags = 0; + if (msgs[k].msg_hdr.msg_flags & MSG_TRUNC) + flags |= UV_UDP_PARTIAL; ++ if (k != 0) ++ flags |= UV_UDP_MMSG_CHUNK; + + chunk_buf = uv_buf_init(iov[k].iov_base, iov[k].iov_len); + handle->recv_cb(handle, +@@ -227,10 +230,6 @@ static int uv__udp_recvmmsg(uv_udp_t* handle, uv_buf_t + msgs[k].msg_hdr.msg_name, + flags); + } +- +- /* one last callback so the original buffer is freed */ +- if (handle->recv_cb != NULL) +- handle->recv_cb(handle, 0, buf, NULL, 0); + } + return nread; + }