Repository navigation
[BREAKING] Reverse SOFTWARE_ATTRIBUTE_OPT to avoid inverse logic - #1598
Merged
Merged
Conversation
Extract adding the attribute into a function to avoid code duplication This option is now not reloadable
Collaborator
Author
|
This is a breaking change so delaying merging for a little |
eakraly
marked this pull request as ready for review
December 13, 2024 05:33
jonesmz
reviewed
Dec 13, 2024
|
|
||
| const char *get_version(turn_turnserver *server) { | ||
| if (server && !*server->no_software_attribute) { | ||
| if (server && server->software_attribute) { |
Contributor
There was a problem hiding this comment.
you're dropping a dereference on this line.
Was the dereference a bug?
jonesmz
approved these changes
Dec 13, 2024
chengpeng-wang
pushed a commit
to chengpeng-wang/coturn
that referenced
this pull request
Mar 24, 2026
…urn#1598) As part of looking at coturn#1588 , I figured that sending `SOFTWARE` attribute is also part of a problem as it increases messages sent out by coturn and thus increasing amplification factor. For 4.6.2, the additional size is 24 bytes (4 bytes attribute header, and 20 bytes for "Coturn-4.6.2 'Gorst'") If we are to use an example from coturn#1588, "A 62 byte request will be met with Coturn’s 401 Unauthorized response which is 150 bytes, a factor of ~2.42." - without SOFTWARE the response will be 126 bytes which reduces amplification factor to ~2. As I observed with multiple providers using coturn - some of the are sending it. Meaning, they do not set `--no-software-attribute` - most probably due to lack of clarity about this setting. I believe sending SOFTWARE_ATTRIBUTE should be off by default which is hinted in the RFC (https://datatracker.ietf.org/doc/html/rfc8489#section-16.1.2) Detailed changes: - Extract setting the attribute into a function to avoid code duplication - This option is now not reloadable - The option is now called `software_attribute` because inverse logic creates multiple double-not in the code which makes it harder to read. - `no-software_attribute` is still functional but marked as deprecated in documentation Test Plan: - Run local tests with different cli arguments (new and deprecated) and confirm SOFTWARE attribute is off by default, and added when arguments say so
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.
As part of looking at #1588 , I figured that sending
SOFTWAREattribute is also part of a problem as it increases messages sent out by coturn and thus increasing amplification factor. For 4.6.2, the additional size is 24 bytes (4 bytes attribute header, and 20 bytes for "Coturn-4.6.2 'Gorst'")If we are to use an example from #1588, "A 62 byte request will be met with Coturn’s 401 Unauthorized response which is 150 bytes, a factor of ~2.42." - without SOFTWARE the response will be 126 bytes which reduces amplification factor to ~2.
As I observed with multiple providers using coturn - some of the are sending it. Meaning, they do not set
--no-software-attribute- most probably due to lack of clarity about this setting.I believe sending SOFTWARE_ATTRIBUTE should be off by default which is hinted in the RFC (https://datatracker.ietf.org/doc/html/rfc8489#section-16.1.2)
Detailed changes:
software_attributebecause inverse logic creates multiple double-not in the code which makes it harder to read.no-software_attributeis still functional but marked as deprecated in documentationTest Plan: