-
Notifications
You must be signed in to change notification settings - Fork 992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable private addresses for ICE based on a per-endpoint flag. #2047
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,7 @@ class IceTransport @JvmOverloads constructor( | |
* unique local ports, rather than the configured port. | ||
*/ | ||
useUniquePort: Boolean, | ||
private val advertisePrivateAddresses: Boolean, | ||
parentLogger: Logger, | ||
private val clock: Clock = Clock.systemUTC() | ||
) { | ||
|
@@ -276,7 +277,7 @@ class IceTransport @JvmOverloads constructor( | |
password = iceAgent.localPassword | ||
ufrag = iceAgent.localUfrag | ||
iceComponent.localCandidates?.forEach { cand -> | ||
cand.toCandidatePacketExtension()?.let { pe.addChildExtension(it) } | ||
cand.toCandidatePacketExtension(advertisePrivateAddresses)?.let { pe.addChildExtension(it) } | ||
} | ||
addChildExtension(IceRtcpmuxPacketExtension()) | ||
} | ||
|
@@ -512,8 +513,10 @@ private fun generateCandidateId(candidate: LocalCandidate): String = buildString | |
append(java.lang.Long.toHexString(candidate.hashCode().toLong())) | ||
} | ||
|
||
private fun LocalCandidate.toCandidatePacketExtension(): CandidatePacketExtension? { | ||
if (!IceConfig.config.advertisePrivateCandidates && transportAddress.isPrivateAddress()) { | ||
private fun LocalCandidate.toCandidatePacketExtension(advertisePrivateAddresses: Boolean): CandidatePacketExtension? { | ||
if (!(advertisePrivateAddresses && IceConfig.config.advertisePrivateCandidates) && | ||
transportAddress.isPrivateAddress() | ||
) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this logic is wrong? |
||
return null | ||
} | ||
val cpe = IceCandidatePacketExtension() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -255,7 +255,8 @@ videobridge { | |
# "NominateFirstValid", "NominateHighestPriority", "NominateFirstHostOrReflexiveValid", or "NominateBestRTT". | ||
nomination-strategy = "NominateFirstHostOrReflexiveValid" | ||
|
||
# Whether to advertise private ICE candidates, i.e. RFC 1918 IPv4 addresses and fec0::/10 and fc00::/7 IPv6 addresses. | ||
# Whether to advertise private ICE candidates, i.e. RFC 1918 IPv4 addresses and fec0::/10 and fc00::/7 IPv6 | ||
# addresses for endpoints that have signaled support for private addresses. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You made the existing advertise-private-candidates config flag mean "advertise private addresses if jicofo requests it", which changes the current behavior -- I think we want it to be "advertise private candidates even if jicofo doesn't request it" to keep compatibility for community users setting the flag today (e.g. running entirely in a private network). |
||
advertise-private-candidates = true | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment what this "true" means