Skip to content
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

New TOS (per socket) options #3571

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

New TOS (per socket) options #3571

wants to merge 2 commits into from

Conversation

nikbyte
Copy link
Member

@nikbyte nikbyte commented Feb 3, 2025

Summary
This PR introduces two key changes:

  1. Allows setting the global TOS (Type of Service) parameter to 0 to disable the IP_TOS socket option.
  2. Adds a per-socket parameter tos, allowing TOS to be set on a per-socket basis. If this parameter is set, it overrides the global value.

Details
Previously, the global TOS parameter could not be set to 0, meaning that disabling the IP_TOS socket option was not straightforward. This PR introduces the ability to explicitly set TOS=0, ensuring that no IP_TOS is applied.

Additionally, this PR introduces a new per-socket tos parameter, which enables granular control over TOS settings on an individual socket level. If a socket-specific value is provided, it takes precedence over the global setting, allowing for more flexible traffic prioritization configurations.

Solution

  • Modified the global TOS handling logic to allow 0 as a valid value.
  • Introduced a per-socket tos parameter in the socket configuration.
  • Ensured that when the per-socket tos value is set, it overrides the global TOS setting.
  • Maintained backward compatibility by preserving previous behaviors unless explicitly overridden.

Compatibility

  • This change maintains backward compatibility as existing configurations remain unchanged unless explicitly modified.
  • The ability to set TOS=0 does not affect existing deployments but provides more flexibility.
  • The per-socket tos parameter is an additional feature that does not interfere with existing configurations.

@nikbyte nikbyte changed the title New TOS options New TOS (per socket) options Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant