Skip to content

ext/sockets: Merge setting mcast option code for IPv4 and 6 #18724

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented May 31, 2025

The handling for IPv4 and 6 seems similar enough that having two different functions doesn't seem to be worth it.

@devnexen
Copy link
Member

I understand the sentiment, hopefully these changes won t bring more issues than it tries to solve. Going to check on my mac what s wrong.


case IP_MULTICAST_IF:
case IPV6_MULTICAST_IF:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah ... I m afraid you just can t do this that way. on mac those two has same values.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah and also Windows... Probably doable with some #if preprocessor directives tho.

@devnexen
Copy link
Member

do not see much of an option has having two still separated ipv4/ipv6 switches but within the same call (e.g. then passing ipv6 flag ?), not sure how much it s worth it though.

@Girgias
Copy link
Member Author

Girgias commented Jun 1, 2025

@devnexen do you know if IP_MULTICAST_TTL accepts a value of -1? I can't seem to find much info about it

@devnexen
Copy link
Member

devnexen commented Jun 1, 2025

@devnexen do you know if IP_MULTICAST_TTL accepts a value of -1? I can't seem to find much info about it

Normally you should get an EINVAL errno error.

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