Repository navigation
Don't send data or sync packets on the discovery universe - #78
Open
stewartadam wants to merge 1 commit into
Open
stewartadam wants to merge 1 commit into
stewartadam wants to merge 1 commit into
Conversation
E1.31-2016 Section 6.2.7 limits data universes to 1-63999. Universe 64214 is reserved for universe discovery, but is_universe_in_range also accepts it (it's needed for the multicast address and for listening), so SacnSource let it be registered, used for data, used as a sync address, and then listed in its own universe discovery adverts. Add is_data_universe_in_range, which excludes the discovery universe, and use it for registering universes, sending data, and sync addresses. The existing test that expected registering 64214 to succeed now expects IllegalUniverse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KzaQVQThQpmqhvLapk99Vs
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.
Summary
E1.31-2016 §6.2.7 limits data universes to 1–63999. Universe 64214 (
E131_DISCOVERY_UNIVERSE) is reserved for universe discovery packets.is_universe_in_rangeaccepts 64214 because the multicast address conversion and the receiver's own discovery listener need it.SacnSourceused the same check, so you could register 64214, send DMX data on it, use it as a sync address, and send sync packets on it. A registered 64214 was then also listed in the source's own discovery adverts.Changes
packet::is_data_universe_in_range, which accepts 1–63999 only.SacnSourceuses it when registering universes, when sending data, for the sync address, and forsend_sync_packet. All of these now returnIllegalUniversefor 64214, orIllegalSyncUniversewhen 64214 is the sync address.is_universe_in_rangeis unchanged, so multicast addressing, discovery and the receiver still work.Behaviour change:
test_register_discovery_universeused to assert that registering 64214 succeeds, citing §6.2.7. That doesn't match the section. The test now expectsIllegalUniverse.Tests
test_send_on_discovery_universe_rejectedcovers data, the sync address and sync packets.test_is_data_universe_in_rangecovers the range edges.cargo testandcargo clippypass, and clippy reports no new warnings.