@@ -194,45 +194,45 @@ void serial_test_cgroup_attach_multi(void)
194
194
195
195
attach_opts .flags = BPF_F_ALLOW_OVERRIDE | BPF_F_REPLACE ;
196
196
attach_opts .replace_prog_fd = allow_prog [0 ];
197
- if (CHECK (!bpf_prog_attach_xattr (allow_prog [6 ], cg1 ,
197
+ if (CHECK (!bpf_prog_attach_opts (allow_prog [6 ], cg1 ,
198
198
BPF_CGROUP_INET_EGRESS , & attach_opts ),
199
199
"fail_prog_replace_override" , "unexpected success\n" ))
200
200
goto err ;
201
201
CHECK_FAIL (errno != EINVAL );
202
202
203
203
attach_opts .flags = BPF_F_REPLACE ;
204
- if (CHECK (!bpf_prog_attach_xattr (allow_prog [6 ], cg1 ,
204
+ if (CHECK (!bpf_prog_attach_opts (allow_prog [6 ], cg1 ,
205
205
BPF_CGROUP_INET_EGRESS , & attach_opts ),
206
206
"fail_prog_replace_no_multi" , "unexpected success\n" ))
207
207
goto err ;
208
208
CHECK_FAIL (errno != EINVAL );
209
209
210
210
attach_opts .flags = BPF_F_ALLOW_MULTI | BPF_F_REPLACE ;
211
211
attach_opts .replace_prog_fd = -1 ;
212
- if (CHECK (!bpf_prog_attach_xattr (allow_prog [6 ], cg1 ,
212
+ if (CHECK (!bpf_prog_attach_opts (allow_prog [6 ], cg1 ,
213
213
BPF_CGROUP_INET_EGRESS , & attach_opts ),
214
214
"fail_prog_replace_bad_fd" , "unexpected success\n" ))
215
215
goto err ;
216
216
CHECK_FAIL (errno != EBADF );
217
217
218
218
/* replacing a program that is not attached to cgroup should fail */
219
219
attach_opts .replace_prog_fd = allow_prog [3 ];
220
- if (CHECK (!bpf_prog_attach_xattr (allow_prog [6 ], cg1 ,
220
+ if (CHECK (!bpf_prog_attach_opts (allow_prog [6 ], cg1 ,
221
221
BPF_CGROUP_INET_EGRESS , & attach_opts ),
222
222
"fail_prog_replace_no_ent" , "unexpected success\n" ))
223
223
goto err ;
224
224
CHECK_FAIL (errno != ENOENT );
225
225
226
226
/* replace 1st from the top program */
227
227
attach_opts .replace_prog_fd = allow_prog [0 ];
228
- if (CHECK (bpf_prog_attach_xattr (allow_prog [6 ], cg1 ,
228
+ if (CHECK (bpf_prog_attach_opts (allow_prog [6 ], cg1 ,
229
229
BPF_CGROUP_INET_EGRESS , & attach_opts ),
230
230
"prog_replace" , "errno=%d\n" , errno ))
231
231
goto err ;
232
232
233
233
/* replace program with itself */
234
234
attach_opts .replace_prog_fd = allow_prog [6 ];
235
- if (CHECK (bpf_prog_attach_xattr (allow_prog [6 ], cg1 ,
235
+ if (CHECK (bpf_prog_attach_opts (allow_prog [6 ], cg1 ,
236
236
BPF_CGROUP_INET_EGRESS , & attach_opts ),
237
237
"prog_replace" , "errno=%d\n" , errno ))
238
238
goto err ;
0 commit comments