Merge "Try SO_RCVBUF before SO_RCVBUFFORCE." am: 3f8fa0c215 am: dfcc7dbad0

am: 602a2ce0e0

Change-Id: I4d4946552edb444f4a3a7ea333f272a7408ec260
This commit is contained in:
Junichi Uekawa 2017-07-13 20:37:17 +00:00 committed by android-build-merger
commit 189527f13f

View file

@ -64,8 +64,11 @@ int NetlinkManager::start() {
return -1;
}
if (setsockopt(mSock, SOL_SOCKET, SO_RCVBUFFORCE, &sz, sizeof(sz)) < 0) {
SLOGE("Unable to set uevent socket SO_RCVBUFFORCE option: %s", strerror(errno));
// When running in a net/user namespace, SO_RCVBUFFORCE is not available.
// Try using SO_RCVBUF first.
if ((setsockopt(mSock, SOL_SOCKET, SO_RCVBUF, &sz, sizeof(sz)) < 0) &&
(setsockopt(mSock, SOL_SOCKET, SO_RCVBUFFORCE, &sz, sizeof(sz)) < 0)) {
SLOGE("Unable to set uevent socket SO_RCVBUF/SO_RCVBUFFORCE option: %s", strerror(errno));
goto out;
}