initial support for new network protocols#37315
Conversation
|
@wfurt As discussed offline, we can't merge this PR as-is. |
|
@davidsh would taking https://github.com/dotnet/corefx/issues/14041 instead sound reasonable? That one is less open-ended but also allows users to consume those protocols |
Yes. We discussed this with @stephentoub, @karelz and @wfurt offline. @wfurt will send out revised proposal shortly. Please follow-up offline via him if you want as well. |
|
I want to investigate little bit more before making next move. I'll update notes here when I'm ready. |
|
I made some updates based on feedback and other discussion:
Long term, in Unix world the protocol is specific to AddressFamily. We did not structure our enum as such. However it seems like there is no name overlap right now. So for near future, we can keep adding values to ProtocolType |
| case AddressFamily_AF_CAN: | ||
| *platformAddressFamily = AF_CAN; | ||
| return true; | ||
| #endif |
There was a problem hiding this comment.
Why isn't there a case AddressFamily_AF_NETLINK?
There was a problem hiding this comment.
For now, I wanted to return Error_EAFNOSUPPORT.
There was a problem hiding this comment.
For now, I wanted to return Error_EAFNOSUPPORT.
Then why are we adding the API?
There was a problem hiding this comment.
For Netlink I wanted to have enough so we can recognize it when we progress on #14041 e.g. we would be able to map platform to protocol enum.
| } | ||
| catch (SocketException e) when (e.SocketErrorCode == SocketError.AccessDenied || | ||
| e.SocketErrorCode == SocketError.ProtocolNotSupported || | ||
| e.SocketErrorCode == SocketError.AddressFamilyNotSupported) |
There was a problem hiding this comment.
If we're ignoring AddressFamilyNotSupported and ProtocolNotSupported, what are we actually testing?
There was a problem hiding this comment.
I wanted to at least exercise PAL code.
For CAN, it is unlikely this will be runable on CI.
I can modify this to expect success on Linux when running as root. If you have other suggestions, please let me know. I can improve tests as follow-up.
* initial support for new network protocols * feedback from review * fix compilation of AF_CAN Commit migrated from dotnet/corefx@6f6790f
This change adds approved enums. I also added basic test for socket creation.
fixes dotnet/runtime#28636