Skip to content

Commit b2d76b6

Browse files
committed
fix: exit on XDP program attachment failure
1 parent 06c7500 commit b2d76b6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mem.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ int load_ebpf_mem_progs() {
218218
/* Attach XDP program to the interface */
219219
bpf_prog_link = bpf_program__attach_xdp(mem_ebpf_skel->progs.read_kernel_memory_xdp, ifindex);
220220
if (!bpf_prog_link) {
221-
fprintf(stderr, "Failed to attach XDP program to interface %s (index: %d)\n", loopback_interface, ifindex);
221+
fprintf(stderr, "Failed to attach XDP program to interface %s...\n", loopback_interface);
222+
return -errno;
222223
}
223224

224225
/* Create socket for sending trigger packets */

0 commit comments

Comments
 (0)