Completed detachment of probes, enabling to attach and detach at will. Work needs to be done with xdp tho

This commit is contained in:
h3xduck
2022-01-02 06:28:45 -05:00
parent d18b0aa23c
commit adaf909781
6 changed files with 55 additions and 4 deletions

View File

@@ -46,9 +46,10 @@ int attach_xdp_all(struct xdp_filter_bpf *skel, __u32 ifindex, __u32 flags){
return 0;
}
int detach_xdp_all(__u32 fd, __u32 ifindex, __u32 flags){
int detach_xdp_all(__u32 ifindex, __u32 fd, __u32 flags){
int err = bpf_set_link_xdp_fd(ifindex, fd, flags);
if(err<0){
perror("j");
fprintf(stderr, "Failed to detach XDP program\n");
return -1;
}