Repository navigation
Use u_char for IP_MULTICAST_LOOP and IP_MULTICAST_TTL on OpenBSD, NetBSD, illumos and Solaris - #687
Open
kristof-mattei wants to merge 1 commit into
Open
kristof-mattei wants to merge 1 commit into
kristof-mattei wants to merge 1 commit into
Conversation
…D, NetBSD, illumos and Solaris `getsockopt` writes 1 byte on all four platforms. `setsockopt` requires a 1-byte value on OpenBSD and illumos. NetBSD's `setsockopt` also accepts a 4-byte value, but returns `EINVAL` for a TTL above 255, so a 1-byte value does not reduce the TTL range. Also prevents `set_multicast_ttl_v4(u32::MAX)` from wrapping to `-1` on Linux, which sets a TTL of 1 instead of returning an error.
kristof-mattei
force-pushed
the
openbsd-ip-multicast-u8
branch
from
November 8, 2026 02:06
27b8643 to
d4d9be2
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
getsockoptwrites 1 byte on all four platforms.setsockoptrequires a 1-byte value on OpenBSD and illumos. NetBSD'ssetsockoptalso accepts a 4-byte value, but returnsEINVALfor a TTL above 255, so a 1-byte value does not reduce the TTL range.Also prevents
set_multicast_ttl_v4(u32::MAX)from wrapping to-1on Linux, which sets a TTL of 1 instead of returning an error.