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

introduce an ECNCapablePacketConn interface to determine ECN support #2788

Merged
merged 1 commit into from
Sep 22, 2020

Conversation

marten-seemann
Copy link
Member

This PR implements solution 2 discussed in #2741 (comment).

TLDR: Currently we only enable ECN support if the user passes a naked *net.UDPConn into Dial and Listen, respectively. With this PR, we'll also enable ECN if the net.PacketConn is a wrapped net.UDPConn, as long as it exposes the required methods SyscallConn and ReadMsgUDP.

Note that this might contain an element of surprise for the user: To read packets from the connection, we won't use ReadFrom any longer, but ReadMsgUDP, so any wrapping of the ReadFrom will be bypassed. I added comments at multiple places to make users aware of this.

@codecov
Copy link

codecov bot commented Sep 15, 2020

Codecov Report

Merging #2788 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2788   +/-   ##
=======================================
  Coverage   86.90%   86.90%           
=======================================
  Files         133      133           
  Lines       10102    10102           
=======================================
  Hits         8779     8779           
  Misses        990      990           
  Partials      333      333           
Impacted Files Coverage Δ
client.go 80.33% <ø> (ø)
server.go 83.70% <ø> (ø)
conn.go 100.00% <100.00%> (ø)
conn_ecn.go 80.39% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 272a2c8...833027b. Read the comment docs.

@marten-seemann marten-seemann merged commit 27448c1 into master Sep 22, 2020
@aschmahmann aschmahmann mentioned this pull request Feb 18, 2021
73 tasks
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.

2 participants