Skip to content

Make TTL and multicast loop settings work on IPv6 sources - #88

Open
stewartadam wants to merge 1 commit into
mainfrom
claude/project-thread-0t11p6-5-ipv6-ttl
Open

stewartadam wants to merge 1 commit into
mainfrom
claude/project-thread-0t11p6-5-ipv6-ttl

Conversation

@stewartadam

@stewartadam stewartadam commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem

SacnSource::ttl, set_ttl, multicast_ttl, set_multicast_ttl and multicast_loop always 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

  • These methods now check the source's address family. IPv6 sources use the equivalent options: unicast hop limit, multicast hop limit and IPV6_MULTICAST_LOOP.
  • New set_multicast_loop(bool) works for either family. set_multicast_loop_v4 is unchanged, and its docs now point to the new method.

Tests

Added test_ttl_and_multicast_loop_ipv4 and test_ttl_and_multicast_loop_ipv6 to tests/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.

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
@stewartadam stewartadam self-assigned this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants