@@ -30,13 +30,23 @@ typedef struct recv_args {
3030} recv_args_t ;
3131
3232static __always_inline enum protocol_type
33- protocol_type_for_conn_info (const connection_info_t * info ) {
34- const enum protocol_type * cached_protocol_type = bpf_map_lookup_elem (& protocol_cache , info );
33+ protocol_type_for_conn_info (const pid_connection_info_t * info ) {
34+ const enum protocol_type * cached_protocol_type =
35+ bpf_map_lookup_elem (& protocol_cache , & info -> conn );
36+ if (!cached_protocol_type ) {
37+ if (already_tracked_http (info )) {
38+ return k_protocol_type_http ;
39+ }
40+ }
3541 return cached_protocol_type ? * cached_protocol_type : k_protocol_type_unknown ;
3642}
3743
38- static __always_inline call_protocol_args_t * make_protocol_args (
39- connection_info_t * info , void * u_buf , int bytes_len , u8 ssl , u8 direction , u16 orig_dport ) {
44+ static __always_inline call_protocol_args_t * make_protocol_args (const pid_connection_info_t * info ,
45+ void * u_buf ,
46+ int bytes_len ,
47+ u8 ssl ,
48+ u8 direction ,
49+ u16 orig_dport ) {
4050 call_protocol_args_t * args = protocol_args ();
4151 if (!args ) {
4252 return 0 ;
@@ -60,7 +70,7 @@ static __always_inline void handle_buf_with_connection(void *ctx,
6070 u8 direction ,
6171 u16 orig_dport ) {
6272 call_protocol_args_t * args =
63- make_protocol_args (& pid_conn -> conn , u_buf , bytes_len , ssl , direction , orig_dport );
73+ make_protocol_args (pid_conn , u_buf , bytes_len , ssl , direction , orig_dport );
6474 if (!args ) {
6575 return ;
6676 }
0 commit comments