File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -238,7 +238,7 @@ int bpf_prog_load(enum bpf_prog_type prog_type,
238
238
const struct bpf_insn * insns , size_t insn_cnt ,
239
239
struct bpf_prog_load_opts * opts )
240
240
{
241
- const size_t attr_sz = offsetofend (union bpf_attr , prog_token_fd );
241
+ const size_t attr_sz = offsetofend (union bpf_attr , fd_array_cnt );
242
242
void * finfo = NULL , * linfo = NULL ;
243
243
const char * func_info , * line_info ;
244
244
__u32 log_size , log_level , attach_prog_fd , attach_btf_obj_fd ;
@@ -311,6 +311,7 @@ int bpf_prog_load(enum bpf_prog_type prog_type,
311
311
attr .line_info_cnt = OPTS_GET (opts , line_info_cnt , 0 );
312
312
313
313
attr .fd_array = ptr_to_u64 (OPTS_GET (opts , fd_array , NULL ));
314
+ attr .fd_array_cnt = OPTS_GET (opts , fd_array_cnt , 0 );
314
315
315
316
if (log_level ) {
316
317
attr .log_buf = ptr_to_u64 (log_buf );
Original file line number Diff line number Diff line change @@ -107,9 +107,12 @@ struct bpf_prog_load_opts {
107
107
*/
108
108
__u32 log_true_size ;
109
109
__u32 token_fd ;
110
+
111
+ /* if set, provides the length of fd_array */
112
+ __u32 fd_array_cnt ;
110
113
size_t :0 ;
111
114
};
112
- #define bpf_prog_load_opts__last_field token_fd
115
+ #define bpf_prog_load_opts__last_field fd_array_cnt
113
116
114
117
LIBBPF_API int bpf_prog_load (enum bpf_prog_type prog_type ,
115
118
const char * prog_name , const char * license ,
You can’t perform that action at this time.
0 commit comments