Skip to content

Commit be62441

Browse files
author
Mirroring
committed
Merge commit '63cb882afa85ee0160999ab1c0b727e866a29aef'
2 parents 5994663 + 63cb882 commit be62441

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3602,15 +3602,15 @@ internal void InternalSetBlocking(bool desired)
36023602
}
36033603

36043604
// CreateAcceptSocket - pulls unmanaged results and assembles them into a new Socket object.
3605-
internal Socket CreateAcceptSocket(SafeSocketHandle fd, EndPoint remoteEP)
3605+
internal Socket CreateAcceptSocket(SafeSocketHandle fd, EndPoint? remoteEP)
36063606
{
36073607
// Internal state of the socket is inherited from listener.
36083608
Debug.Assert(fd != null && !fd.IsInvalid);
36093609
Socket socket = new Socket(fd, loadPropertiesFromHandle: false);
36103610
return UpdateAcceptSocket(socket, remoteEP);
36113611
}
36123612

3613-
internal Socket UpdateAcceptSocket(Socket socket, EndPoint remoteEP)
3613+
internal Socket UpdateAcceptSocket(Socket socket, EndPoint? remoteEP)
36143614
{
36153615
// Internal state of the socket is inherited from listener.
36163616
socket._addressFamily = _addressFamily;

src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Unix.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ private void CompleteAcceptOperation(IntPtr acceptedFileDescriptor, Memory<byte>
3535
_acceptedFileDescriptor = acceptedFileDescriptor;
3636
if (socketError == SocketError.Success)
3737
{
38-
Debug.Assert(socketAddress.Length > 0);
3938
_acceptAddressBufferCount = socketAddress.Length;
4039
}
4140
else
@@ -348,9 +347,10 @@ private SocketError FinishOperationAccept(SocketAddress remoteSocketAddress)
348347
new ReadOnlySpan<byte>(_acceptBuffer, 0, _acceptAddressBufferCount).CopyTo(remoteSocketAddress.Buffer.Span);
349348
remoteSocketAddress.Size = _acceptAddressBufferCount;
350349

350+
// on macOS accept can sometimes return empty remote address even when it returns successfully.
351351
Socket acceptedSocket = _currentSocket!.CreateAcceptSocket(
352352
SocketPal.CreateSocket(_acceptedFileDescriptor),
353-
_currentSocket._rightEndPoint!.Create(remoteSocketAddress));
353+
remoteSocketAddress.Size > 0 ? _currentSocket._rightEndPoint!.Create(remoteSocketAddress) : null);
354354
if (_acceptSocket is null)
355355
{
356356
// Store the accepted socket

src/mono/mono.proj

+1
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,7 @@ JS_ENGINES = [NODE_JS]
819819
<ItemGroup Condition="'$(AotHostOS)' == 'linux'">
820820
<_LibClang Include="$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/lib/libclang.so" Condition=" Exists('$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/lib/libclang.so') "/>
821821
<_LibClang Include="$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/lib64/libclang.so.*" Condition=" '$(_LibClang)' == '' "/>
822+
<_LibClang Include="/usr/local/lib/libclang.so" Condition="'$(_LibClang)' == ''" />
822823
</ItemGroup>
823824
<PropertyGroup Condition="'$(TargetsLinux)' == 'true' and '$(Platform)' == 'arm64'">
824825
<MonoUseCrossTool>true</MonoUseCrossTool>

src/native/libs/System.Native/pal_networking.c

+5
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,11 @@ int32_t SystemNative_Connect(intptr_t socket, uint8_t* socketAddress, int32_t so
16601660
return err == 0 ? Error_SUCCESS : SystemNative_ConvertErrorPlatformToPal(errno);
16611661
}
16621662

1663+
#if defined(__linux__) && !defined(TCP_FASTOPEN_CONNECT)
1664+
// fixup if compiled against old Kernel headers.
1665+
// Can be removed once we have at least 4.11
1666+
#define TCP_FASTOPEN_CONNECT 30
1667+
#endif
16631668
int32_t SystemNative_Connectx(intptr_t socket, uint8_t* socketAddress, int32_t socketAddressLen, uint8_t* data, int32_t dataLen, int32_t tfo, int* sent)
16641669
{
16651670
if (socketAddress == NULL || socketAddressLen < 0 || sent == NULL)

src/tests/JIT/Directed/tls/TestTLSWithLoadedDlls.csproj

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<RequiresProcessIsolation>true</RequiresProcessIsolation>
55
<ReferenceXUnitWrapperGenerator>false</ReferenceXUnitWrapperGenerator>
66
<NativeAotIncompatible>true</NativeAotIncompatible>
7+
<!-- Tracking issue: https://github.com/dotnet/runtime/issues/92129 -->
8+
<CLRTestTargetUnsupported Condition="'$(TargetsAppleMobile)' == 'true'">true</CLRTestTargetUnsupported>
79
</PropertyGroup>
810
<PropertyGroup>
911
<DebugType>PdbOnly</DebugType>

0 commit comments

Comments
 (0)