Skip to content

Conversation

@liveans
Copy link
Member

@liveans liveans commented Sep 9, 2025

Backport of #119354 to release/9.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.

Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

)

* 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 <tweinfurt@yahoo.com>
Copilot AI review requested due to automatic review settings September 9, 2025 08:20
Copy link
Contributor

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 PR backports a fix for IPv4 multicast socket options on macOS/OSX by adding support for IP_MULTICAST_IFINDEX when the ip_mreqn struct is not available. The fix addresses platform-specific networking issues where the standard ip_mreqn structure wasn't supported.

  • Adds build-time detection for IP_MULTICAST_IFINDEX socket option availability
  • Implements fallback logic to use IP_MULTICAST_IFINDEX for interface index specification on macOS
  • Removes test exclusion for Apple mobile platforms that was previously needed due to this issue

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 configuration check for IP_MULTICAST_IFINDEX availability
src/native/libs/System.Native/pal_networking.c Implements IP_MULTICAST_IFINDEX fallback logic for multicast interface setting
src/native/libs/Common/pal_config.h.in Defines configuration macro for IP_MULTICAST_IFINDEX feature detection
src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs Removes ActiveIssue attribute that excluded Apple mobile platforms from multicast tests

@liveans liveans requested a review from a team September 9, 2025 08:22
@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