Make ZMQ_TOS work with IPv6 sockets #2209
Merged
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:
To set
Type Of Service
for IP layer packets ZMQ providesZMQ_TOS
socketoption. However this only works for v4 sockets. Considering things are moving to
IPv6 heavily (especially within enterprise networks), ZMQ should support setting
traffic class
for v6 based onZMQ_TOS
.There is a subtle difference between v4 and v6 in terms of the positioning of
field but TOS has same meaning in both v4 and v6. Linux provides following APIs
for v4/v6 to set TOS field value.
Test Plan:
Make sure Cmake works fine and all tests passes.
Imported this change to
OpenR
project and tested on our local testbed.Captured some packets exchanged between PUB/SUB and ROUTER/ROUTER sockets
pairs. Verify that
TCLASS
value is set as per expectation.Tasks: #2208