Skip to content

fix: enable http3 panic #5671

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

Xunzhuo
Copy link
Member

@Xunzhuo Xunzhuo commented Apr 7, 2025

What type of PR is this?

What this PR does / why we need it:

These changes ensure that when HTTP/3 is enabled through a ClientTrafficPolicy, the TLS inspector filter is only added to TCP listeners, not to UDP (QUIC) listeners, which prevents the nil pointer dereference.

Which issue(s) this PR fixes:

Fixes #5660

Release Notes: Yes/No

@Xunzhuo Xunzhuo requested a review from a team as a code owner April 7, 2025 03:54
Copy link

codecov bot commented Apr 7, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 65.29%. Comparing base (e374db4) to head (8cddc33).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/xds/translator/listener.go 80.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5671      +/-   ##
==========================================
+ Coverage   65.20%   65.29%   +0.08%     
==========================================
  Files         213      213              
  Lines       34108    34115       +7     
==========================================
+ Hits        22241    22276      +35     
+ Misses      10521    10500      -21     
+ Partials     1346     1339       -7     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

if err := addXdsTLSInspectorFilter(xdsListener); err != nil {
return err
// Only add TLS inspector filter if the listener is not nil and is a TCP listener
if xdsListener != nil && xdsListener.GetAddress().GetSocketAddress().GetProtocol() == corev3.SocketAddress_TCP {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also not add ServerNameMatch for UDP/HTTP3.

@aaronschif
Copy link

Is this related to #5005?

@zhaohuabing
Copy link
Member

Is this related to #5005?

Yes, TlsInspector and ServerNameMatch should not be added to HTTP3/UDP.

Signed-off-by: bitliu <[email protected]>
@Xunzhuo Xunzhuo requested a review from zhaohuabing April 9, 2025 06:35
@@ -511,14 +511,20 @@ func buildEarlyHeaderMutation(headers *ir.HeaderSettings) []*corev3.TypedExtensi
}

func addServerNamesMatch(xdsListener *listenerv3.Listener, filterChain *listenerv3.FilterChain, hostnames []string) error {
// Dont add a filter chain match if the hostname is a wildcard character.
// Don't add a filter chain match if the hostname is a wildcard character or if the listener is UDP (HTTP3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be easier to read if the skip is moved to the top

if xdsListener == nil || xdsListener.GetAddress().GetSocketAddress().GetProtocol() != corev3.SocketAddress_UDP 
return nil

lamacorp-bot pushed a commit to LamaCorp/infra-infrastructure that referenced this pull request Apr 17, 2025
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.

Nil pointer exception when enabling http3
4 participants