Repository navigation
Stabilize ICE-lite priorities like libwebrtc - #7
Merged
Merged
Conversation
This reverts commit f747420.
History: PR pion#959 let ICE-lite agents pick the best pair locally without sending checks. All lite host candidates had the same priority, so with several candidates the two sides could pick different pairs and fail to connect. pion#968 fixed that by stepping each new lite candidate down from the default until its priority was unique. That made priorities depend on gather order: the same address could get a different priority on another node, or depending on whether the node was single- or dual-stack. The main problem is that Pion doesn't have local preference like libwebrtc, instead of doing other hacks this adds: `(counter << 8) | address precedence`. The low byte is the RFC 6724 precedence of the address (IPv6 40, IPv4 30, and so on), so address families never collide. The counter drops only to separate candidates of the same family. A candidate's priority no longer depends on gather order or on whether the agent is single- or dual-stack. Unlike libwebrtc, the high byte is not a network adapter preference, since Pion has no adapter types.
|
|
boks1971
approved these changes
Nov 9, 2026
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.
pion#1060