Skip to content

Add OpenBSD support in System.Net.NetworkInformation#129279

Open
sethjackson wants to merge 3 commits into
dotnet:mainfrom
sethjackson:port-sys-netinfo-openbsd
Open

Add OpenBSD support in System.Net.NetworkInformation#129279
sethjackson wants to merge 3 commits into
dotnet:mainfrom
sethjackson:port-sys-netinfo-openbsd

Conversation

@sethjackson

@sethjackson sethjackson commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

There is already support in System.Native for this. Just need to enable it in the managed layer for OpenBSD.

Note that FreeBSD includes what appears to be a spurious FreeBSD specific Interop.Libraries.cs file which only contains the MsQuic constant and since that doesn't appear to be used in System.Net.NetworkInformation I haven't included it here and msquic won't work as it stands on OpenBSD today anyways.

Contributes to #124911.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@am11

am11 commented Jun 11, 2026

Copy link
Copy Markdown
Member

Did you try running its tests on the device? If not, bootstrap docs in main branch have steps to build single library with zip archive, copy the zip archive and testhost from host to OpenBSD machine and invoke RunTests.sh command mentioned in the docs.

@sethjackson

Copy link
Copy Markdown
Contributor Author

I did not run tests but I’ll look at the docs and run them and post back.

@sethjackson

sethjackson commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

I was struggling to get this to run on my system then I realized that I was on 7.9 which was recently released but cross build infra is on 7.8.

What is involved in updating that to 7.9 besides updating the cross root FS stuff in dotnet/arcade?

On 7.8 the tests fail with the following:

System.PlatformNotSupportedException : System.Net.NetworkInformation  is not supported on this platform.

A longer trace:

System.Net.NetworkInformation.Tests.ConnectionsParsingTests.ActiveTcpConnectionsParsing [FAIL]
      System.PlatformNotSupportedException : System.Net.NetworkInformation is not supported on this platform.
      Stack Trace:
        /runtime/artifacts/obj/System.Net.NetworkInformation/Debug/net11.0/System.Net.NetworkInformation.notsupported.cs(548,0): at System.Net.NetworkInformation.TcpConnectionInformation..ctor()
        /runtime/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SimpleTcpConnectionInformation.Unix.cs(8,0): at System.Net.NetworkInformation.SimpleTcpConnectionInformation..ctor(IPEndPoint localEndPoint, IPEndPoint remoteEndPoint, TcpState state)
        /runtime/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/StringParsingHelpers.Connections.cs(265,0): at System.Net.NetworkInformation.StringParsingHelpers.ParseTcpConnectionInformationFromLine(String line)
        /runtime/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/StringParsingHelpers.Connections.cs(71,0): at System.Net.NetworkInformation.StringParsingHelpers.ParseActiveTcpConnectionsFromFiles(String tcp4ConnectionsFile, String tcp6ConnectionsFile)
        /runtime/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/ConnectionsParsingTests.cs(48,0): at System.Net.NetworkInformation.Tests.ConnectionsParsingTests.ActiveTcpConnectionsParsing()
           at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
        /runtime/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs(1188,0): at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /runtime/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs(37,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /runtime/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

So not entirely sure what I did wrong here? I did the cross build and test packaging from my branch that has this patch.

@sethjackson

Copy link
Copy Markdown
Contributor Author

@am11

am11 commented Jun 12, 2026

Copy link
Copy Markdown
Member

I was struggling to get this to run on my system then I realized that I was on 7.9 which was recently released but cross build infra is on 7.8.

It is best to start with "lowest version which is not out of support" and that version is 7.8. What is the error on 7.9? Lets discuss it in main thread #124911.

PlatformNotSupportedException

When in doubt, piggyback on git grep -i freebsd -- ':/src/libraries/System.Net.NetworkInformation'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants