Skip to content

Conversation

liveans
Copy link
Member

@liveans liveans commented Sep 9, 2025

Backport of #119354 to release/8.0-staging

/cc @liveans

Customer Impact

  • Customer reported
  • Found internally

[Select one or both of the boxes. Describe how this issue impacts customers, citing the expected and actual behaviors and scope of the issue. If customer-reported, provide the issue number.]

Regression

  • Yes
  • No

[If yes, specify when the regression was introduced. Provide the PR or commit if known.]

Testing

For SocketOption, it has been tested through CI, manual test runs, for actual multicast behavior we made a limited manual testing.

Risk

Low, this was broken for a while.

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

)

* 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]>
@Copilot Copilot AI review requested due to automatic review settings September 9, 2025 08:21
Copy link
Contributor

@Copilot Copilot AI left a 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 is a backport fixing IPv4 multicast socket option handling on macOS/OSX systems. The issue stems from the fact that the ip_mreqn struct is not supported on macOS, requiring the use of IP_MULTICAST_IFINDEX socket option instead for interface index specification.

Key changes:

  • Adds detection for IP_MULTICAST_IFINDEX availability during build configuration
  • Implements fallback logic to use IP_MULTICAST_IFINDEX when ip_mreqn is not available
  • Removes test exclusion for Apple mobile platforms since the issue is now resolved

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/native/libs/configure.cmake Adds build-time check for IP_MULTICAST_IFINDEX socket option availability
src/native/libs/Common/pal_config.h.in Defines configuration macro for IP_MULTICAST_IFINDEX detection
src/native/libs/System.Native/pal_networking.c Implements fallback logic using IP_MULTICAST_IFINDEX when setting IPv4 multicast interface options
src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs Removes test exclusion for Apple mobile platforms

@liveans liveans closed this Sep 12, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants