Skip to content

RECVTOS support (including macOS) #376

Open
@past-due

Description

@past-due

Saw a commit about disabling IP_RECVTOS support on macOS (ref: 1736cfa), and I thought I’d make a note of some findings from taking a brief look into it.

Useful references

Configuring UDP Sockets for ECN for Common Platforms:
https://www.ietf.org/archive/id/draft-duke-tsvwg-udp-ecn-01.html

macOS support

The documentation I’ve found (including the above) would seem to indicate that this line:

if ( unlikely( cmsg->cmsg_level != IPPROTO_IP || cmsg->cmsg_type != IP_TOS ) )

Should be checking cmsg->cmsg_type != IP_RECVTOS when defined(__APPLE__) (IP_RECVTOS does differ in value from IP_TOS in the macOS SDK headers).

If a UDP message (UDP/IPv4) is received on an IPv4 socket, the ancillary data will contain a cmsg of level IPPROTO_IP and type IP_RECVTOS. The cmsg data contains an unsigned char.

IPv6 support

See the reference document above, which details how to implement this across Linux + macOS + Windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions