-
Couldn't load subscription status.
- Fork 5.2k
[OSX] ip_mreqn struct is not supported for IPv4 Multicast #119354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Tagging subscribers to this area: @dotnet/ncl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a macOS compatibility issue where the ip_mreqn struct is not supported for IPv4 multicast socket operations. The fix prevents the use of ip_mreqn on Apple platforms, resolving exceptions when setting the MulticastInterface socket option.
Key changes:
- Excludes Apple platforms from using the
ip_mreqnstruct in IPv4 multicast operations - Allows the code to fall back to alternative multicast handling approaches on macOS
|
Looking at the code, we will throw if the interface index is set since |
|
While reading the kernel code to understand how to make it work, I stumbled upon /cc @wfurt |
8cbb38d to
5cc12a8
Compare
|
Do we think this will fix it for iOS too? The test |
|
/azp list |
|
Should I run ioslike pipeline for it ? @vcsjones |
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
This PR also fixes the issue for other Apple platforms, only left issue is:
|
…IFINDEX for interface index specification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. thanks @liveans for diffing in.
|
/ba-g xml test failure is not related |
|
/backport to release/10.0 |
|
Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/17573854114 |
|
/backport to release/9.0-staging |
|
/backport to release/8.0-staging |
|
Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/17574101803 |
|
Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/17574100129 |
|
@liveans backporting to "release/8.0-staging" failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Fix IPv4 multicast on macOS by handling ip_mreqn struct compatibility
Applying: Remove Active Issue for iOS
Using index info to reconstruct a base tree...
M src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs
Falling back to patching base and 3-way merge...
Auto-merging src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs
CONFLICT (content): Merge conflict in src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Remove Active Issue for iOS
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
|
@liveans backporting to "release/9.0-staging" failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Fix IPv4 multicast on macOS by handling ip_mreqn struct compatibility
Applying: Remove Active Issue for iOS
Using index info to reconstruct a base tree...
M src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs
Falling back to patching base and 3-way merge...
Auto-merging src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs
CONFLICT (content): Merge conflict in src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Remove Active Issue for iOS
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
) * Fix IPv4 multicast on macOS by handling ip_mreqn struct compatibility * Remove Active Issue for iOS * Add support for IP_MULTICAST_IFINDEX * Refactor IPv4 multicast option handling to directly use IP_MULTICAST_IFINDEX for interface index specification * Accept 0 interface as valid --------- Co-authored-by: Tomas Weinfurt <[email protected]>
) * Fix IPv4 multicast on macOS by handling ip_mreqn struct compatibility * Remove Active Issue for iOS * Add support for IP_MULTICAST_IFINDEX * Refactor IPv4 multicast option handling to directly use IP_MULTICAST_IFINDEX for interface index specification * Accept 0 interface as valid --------- Co-authored-by: Tomas Weinfurt <[email protected]>
Fixes #118654 and #113827
With this fix we can set MulticastInterface socket option successfully, I tested the Multicast capabilities, and it seems to be working as expected.
Seems like Apple doesn't support
ip_mreqnstruct with IPv4 Sockets. Kernel header file description/cc @vcsjones @wfurt