Imported Upstream version 5.16.0.149

Former-commit-id: 14c55149475ede19ed48b6a8018dc6d18549c21b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-09-07 08:27:29 +00:00
parent 3ba69ac8f6
commit c92293d6a6
53 changed files with 141 additions and 65 deletions

View File

@@ -1 +1 @@
43e79bb02715ef88b41fd6dc800e96b3f58ff973
2e6aca36b1f1bc468d57c112a6812fecd62982b0

View File

@@ -1 +1 @@
9b782c31cf1cda31f6ee1a3b9e12cf3bd723fb30
9d073102395241a169f95cfba5a149ed33df2f5c

View File

@@ -1711,6 +1711,7 @@ int32_t SystemNative_GetSockOpt(
return Error_EINVAL;
}
#ifdef SO_REUSEPORT
socklen_t optLen = (socklen_t)*optionLen;
// On Unix, SO_REUSEPORT controls the ability to bind multiple sockets to the same address.
int err = getsockopt(fd, SOL_SOCKET, SO_REUSEPORT, optionValue, &optLen);
@@ -1731,7 +1732,9 @@ int32_t SystemNative_GetSockOpt(
value = value == 0 ? 1 : 0;
}
*(int32_t*)optionValue = value;
#else
*optionValue = 0;
#endif
return Error_SUCCESS;
}
}
@@ -1790,6 +1793,7 @@ SystemNative_SetSockOpt(intptr_t socket, int32_t socketOptionLevel, int32_t sock
// We make both SocketOptionName_SO_REUSEADDR and SocketOptionName_SO_EXCLUSIVEADDRUSE control SO_REUSEPORT.
if (socketOptionName == SocketOptionName_SO_EXCLUSIVEADDRUSE || socketOptionName == SocketOptionName_SO_REUSEADDR)
{
#ifdef SO_REUSEPORT
if (optionLen != sizeof(int32_t))
{
return Error_EINVAL;
@@ -1812,6 +1816,9 @@ SystemNative_SetSockOpt(intptr_t socket, int32_t socketOptionLevel, int32_t sock
int err = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &value, (socklen_t)optionLen);
return err == 0 ? Error_SUCCESS : SystemNative_ConvertErrorPlatformToPal(errno);
#else
return Error_SUCCESS;
#endif
}
}
#ifdef IP_MTU_DISCOVER