Repository navigation
Make TTL and multicast loop settings work on IPv6 sources - #88
Open
stewartadam wants to merge 1 commit into
Open
stewartadam wants to merge 1 commit into
stewartadam wants to merge 1 commit into
Conversation
ttl, set_ttl, multicast_ttl, set_multicast_ttl and multicast_loop used the IPv4 socket options unconditionally, so they always returned an error on an IPv6 source. They now use the IPv6 hop limit and loop options when the source is bound to an IPv6 address. Adds set_multicast_loop, which works for either family; set_multicast_loop_v4 is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KzaQVPkrkczgX2g7wGkip5
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.
Problem
SacnSource::ttl,set_ttl,multicast_ttl,set_multicast_ttlandmulticast_loopalways used the IPv4 socket options (IP_TTL,IP_MULTICAST_TTL,IP_MULTICAST_LOOP). On a source bound to an IPv6 address, every one of them returned an error.Fix
IPV6_MULTICAST_LOOP.set_multicast_loop(bool)works for either family.set_multicast_loop_v4is unchanged, and its docs now point to the new method.Tests
Added
test_ttl_and_multicast_loop_ipv4andtest_ttl_and_multicast_loop_ipv6totests/src_tests.rs. Each sets then reads back the TTL, multicast TTL and loop flag. The IPv6 test skips itself when the host has no IPv6 stack.The environment I developed in has no IPv6, so only the IPv4 test ran locally (passing). The IPv6 path will first be exercised by CI on GitHub's runners.