Commit 0d4a6008 authored by Yi Kong's avatar Yi Kong
Browse files

Revert "Revert "recvfrom should set srcAddress for empty packets""

This reverts commit 94767318.

recvfrom(2) may return 0 if:
 * packet received has zero length
 * the socket has performed orderly shutdown

Previous Libcore change 6e888e93 tried to handle the second case but
broke the first case and never fills in srcAddress for empty packets.

Added a condition to only fill in srcAddress if the sockaddr is an
InetSocketAddress.

Test: libcore.io.OsTest
Bug: 33483694
Bug: 27294715
Bug: 27233089
Change-Id: I50847bf813e20b02f5ac88d664e77622c28f3704
parent c6c543e1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment