Skip to content

Commit

Permalink
change http2_fetch_stream to bpf_map_lookup_elem in eos (#23036)
Browse files Browse the repository at this point in the history
[USM] Use stream starts with headers in HTTP/2 EOS
  • Loading branch information
amitslavin authored Feb 21, 2024
1 parent bbe80bc commit e89df0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/network/ebpf/c/protocols/http2/decoding-tls.h
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,8 @@ int uprobe__http2_tls_eos_parser(struct pt_regs *ctx) {
}

http2_ctx->http2_stream_key.stream_id = current_frame.frame.stream_id;
current_stream = http2_fetch_stream(&http2_ctx->http2_stream_key);
// A new stream must start with a request, so if it does not exist, we should not process it.
current_stream = bpf_map_lookup_elem(&http2_in_flight, &http2_ctx->http2_stream_key);
if (current_stream == NULL) {
continue;
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/network/ebpf/c/protocols/http2/decoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,8 @@ int socket__http2_eos_parser(struct __sk_buff *skb) {
}

http2_ctx->http2_stream_key.stream_id = current_frame.frame.stream_id;
current_stream = http2_fetch_stream(&http2_ctx->http2_stream_key);
// A new stream must start with a request, so if it does not exist, we should not process it.
current_stream = bpf_map_lookup_elem(&http2_in_flight, &http2_ctx->http2_stream_key);
if (current_stream == NULL) {
continue;
}
Expand Down

0 comments on commit e89df0b

Please sign in to comment.