Repository navigation
feat(torrent): advertise uTP and encryption, and find LAN peers over IPv6 - #513
Merged
Merged
Conversation
The engine speaks uTP (BEP 29) and MSE/PE, so the controller lists both whatever the live utp and encryption settings say: capabilities describe the backend.
Join the BEP 14 IPv6 group [ff15::efc0:988f]:6771 on interfaces with a link-local or unique local address, on the same socket as the IPv4 group, and announce to both with each group's Host header. IPv6 announces go to the group scoped to each interface, as macOS finds no route to it otherwise. Unique local senders are dialed; link-local ones are not, as peer endpoints carry no zone. The network-change check covers both families.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Contributor
Test Results 1 855 files ± 0 1 882 suites ±0 20m 27s ⏱️ - 1m 33s Results for commit d821557. ± Comparison against base commit ffad2f1. This pull request removes 1 and adds 14 tests. Note that renamed tests count towards both. |
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
utpandmse-pe(TorrentCapability.UTPandENCRYPTION). They describe what the engine can speak, so they stay listed when theutpsetting is off orencryptionisoff; those settings change live without the backend gaining or losing the protocol.seedingstill follows the live upload policy. REST (/api/torrents/capabilities) andRemoteTorrentControllerpass the names through unchanged.JvmLsdTransportjoins[ff15::efc0:988f]:6771on the same dual-stack socket as the IPv4 group, on every non-point-to-point interface with a link-local or unique local IPv6 address.LsdTransport.sendnow takes theLsdAnnounceand writes each group'sHostheader (LSD_HOST_IPV4/LSD_HOST_IPV6). IPv6 announces go to the group scoped to each interface, because macOS reports "No route to host" forff15::without a zone even with the multicast interface set.isCurrentcompares both families' interfaces. It compares IPv4 addresses and link-local/ULA IPv6 addresses, never rotating global ones.lsdPeerDialable), becausePeerEndpointcarries no zone id to dial them.Tests
TorrentDownloadSourceTest: exact capability set, and both names stay listed with uTP and encryption off.TorrentLocalDiscoveryTest: IPv6Hostencoding, sender filtering (ULA delivered; link-local, global and loopback not).TorrentLocalDiscoveryEngineTest: a ULA LAN peer is dialed by a v1 swarm and by a hybrid's v2 swarm.JvmLsdTransportTest: real IPv6 multicast between two transports (skipped where the system refuses). It ran and passed locally on macOS, as did IPv4.:library:torrent:jvmTest,:library:torrent:compileTestKotlinIosSimulatorArm64,:library:torrent-api:jvmTest,:library:server:testand:library:remote:jvmTest.