Skip to content

Commit

Permalink
Use program ID 0 on detached link ids
Browse files Browse the repository at this point in the history
Internally both zero and EBPF_ID_NONE are used to refer to non-existing ID.
Use zero when retrieving link info, since that aligns with Linux better.
  • Loading branch information
lmb committed Dec 16, 2024
1 parent 0d2ff77 commit ebf8acb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/execution_context/ebpf_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ ebpf_link_get_info(

memset(info, 0, sizeof(*info));
info->id = link->object.id;
info->prog_id = (link->program) ? ((ebpf_core_object_t*)link->program)->id : EBPF_ID_NONE;
info->prog_id = (link->program) ? ((ebpf_core_object_t*)link->program)->id : 0;
info->type = link->link_type;
info->program_type_uuid = link->program_type;
info->attach_type_uuid = link->attach_type;
Expand Down

0 comments on commit ebf8acb

Please sign in to comment.