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

wire: use netip.AddrPort in the Preferred Address transport parameter #4232

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

marten-seemann
Copy link
Member

The previous code had the subtle problem that it would append the IPv6, assuming that it's a 16 byte byte slice:

b = append(b, p.PreferredAddress.IPv6...)

This assumption is not correct if PreferredAddress.IPv6 was left at its default value. The encode value of the transport parameter then has an incorrect length.

Copy link

codecov bot commented Jan 3, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (1083d1f) 84.15% compared to head (32b6450) 84.15%.
Report is 1 commits behind head on master.

Files Patch % Lines
internal/wire/transport_parameters.go 83.33% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4232      +/-   ##
==========================================
- Coverage   84.15%   84.15%   -0.01%     
==========================================
  Files         149      149              
  Lines       15386    15381       -5     
==========================================
- Hits        12948    12943       -5     
  Misses       1941     1941              
  Partials      497      497              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@marten-seemann marten-seemann changed the title wire: use netip.AddrPort to encode the IPs in the Preferred Address wire: use netip.AddrPort for IPs in the Preferred Address transport parameter Jan 3, 2024
@marten-seemann marten-seemann changed the title wire: use netip.AddrPort for IPs in the Preferred Address transport parameter wire: use netip.AddrPort in the Preferred Address transport parameter Jan 3, 2024
@marten-seemann marten-seemann merged commit 8cad3d2 into master Jan 3, 2024
34 checks passed
@marten-seemann marten-seemann deleted the preferred-address-ip-encoding branch January 4, 2024 02:40
nanokatze pushed a commit to nanokatze/quic-go that referenced this pull request Feb 1, 2024
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.

None yet

1 participant