diff options
Diffstat (limited to 'deps/uv/src/unix/udp.c')
-rw-r--r-- | deps/uv/src/unix/udp.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/deps/uv/src/unix/udp.c b/deps/uv/src/unix/udp.c index efc180c78d..206c65d34f 100644 --- a/deps/uv/src/unix/udp.c +++ b/deps/uv/src/unix/udp.c @@ -221,16 +221,17 @@ static void uv__udp_recvmsg(uv_loop_t* loop, handle->recv_cb(handle, -errno, &buf, NULL, 0); } else { - flags = 0; + const struct sockaddr *addr; + if (h.msg_namelen == 0) + addr = NULL; + else + addr = (const struct sockaddr*) &peer; + flags = 0; if (h.msg_flags & MSG_TRUNC) flags |= UV_UDP_PARTIAL; - handle->recv_cb(handle, - nread, - &buf, - (const struct sockaddr*) &peer, - flags); + handle->recv_cb(handle, nread, &buf, addr, flags); } } /* recv_cb callback may decide to pause or close the handle */ |