• Saif Hasan's avatar
    Make ZMQ_TOS work with IPv6 sockets · fc8007e8
    Saif Hasan authored
    Summary:
    To set `Type Of Service` for IP layer packets ZMQ provides `ZMQ_TOS` socket
    option. 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 on `ZMQ_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.
    ```
    // For v4
    setsockopt(fd, IPPROTO_IP, IP_TOS, tos, sizeof(tos));
    
    // For v6
    setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, tos, sizeof(tos));
    ```
    
    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
    fc8007e8
Name
Last commit
Last update
RELICENSE Loading commit data...
builds Loading commit data...
doc Loading commit data...
include Loading commit data...
m4 Loading commit data...
packaging Loading commit data...
perf Loading commit data...
src Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
.hgeol Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
CMakeLists.txt Loading commit data...
COPYING Loading commit data...
COPYING.LESSER Loading commit data...
Dockerfile Loading commit data...
Doxygen.cfg Loading commit data...
FindSodium.cmake Loading commit data...
INSTALL Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README.cygwin.md Loading commit data...
README.doxygen.md Loading commit data...
README.md Loading commit data...
acinclude.m4 Loading commit data...
appveyor.yml Loading commit data...
autogen.sh Loading commit data...
branding.bmp Loading commit data...
ci_build.sh Loading commit data...
ci_deploy.sh Loading commit data...
configure.ac Loading commit data...
installer.ico Loading commit data...
version.sh Loading commit data...