Skip to content

fix ecn on dual-stack sockets in both directions - #4

Merged
aotodev merged 1 commit into
masterfrom
3-ecn-is-lost-on-dual-stack-sockets-in-both-directions
Sep 30, 2026
Merged

aotodev merged 1 commit into
masterfrom
3-ecn-is-lost-on-dual-stack-sockets-in-both-directions

Conversation

@aotodev

@aotodev aotodev commented Sep 30, 2026

Copy link
Copy Markdown
Owner

IPv4 peers of a dual-stack v6 socket go through the kernel's IPv4 path.
On receive that path reports IP_TOS and never IPV6_TCLASS, so ecn read
as absent. On send it ignores IPV6_TCLASS, so the marking was dropped
without an error.

ecn::enable now also sets IP_RECVTOS on v6 sockets. The transmit batch
passes each feature the destination's wire_family() rather than the
socket's family, so datagrams to v4-mapped peers carry IP_TOS.
pktinfo::build accepts the v4-mapped local address a dual-stack socket
reports, so a reply can reuse the local_info it received.

Add endpoint::is_v4_mapped() and endpoint::wire_family().

Closes #3

@aotodev aotodev self-assigned this Sep 30, 2026
@aotodev
aotodev merged commit 3688a5b into master Sep 30, 2026
7 checks passed
@aotodev
aotodev deleted the 3-ecn-is-lost-on-dual-stack-sockets-in-both-directions branch September 30, 2026 12:01
@aotodev aotodev linked an issue Sep 30, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ECN is lost on dual-stack sockets, in both directions

1 participant