From 79584536e53706790f88d0f3d85fdca61d5abdb3 Mon Sep 17 00:00:00 2001 From: Dave Thaler Date: Thu, 7 Nov 2024 01:45:00 -0800 Subject: [PATCH] Fix ebpf_base.h usability in C Signed-off-by: Dave Thaler --- src/ebpf_base.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ebpf_base.h b/src/ebpf_base.h index c44062d6f..812648329 100644 --- a/src/ebpf_base.h +++ b/src/ebpf_base.h @@ -40,11 +40,11 @@ typedef struct _ebpf_context_descriptor { // Maximum number of nested function calls allowed in eBPF programs. // This limit helps prevent stack overflow and ensures predictable behavior. -constexpr int MAX_CALL_STACK_FRAMES = 8; +#define MAX_CALL_STACK_FRAMES 8 // Stack space allocated for each subprogram (in bytes). // This ensures each function call has its own dedicated stack space. -constexpr int EBPF_SUBPROGRAM_STACK_SIZE = 512; +#define EBPF_SUBPROGRAM_STACK_SIZE 512 // Total stack space usable with nested subprogram calls. -constexpr int EBPF_TOTAL_STACK_SIZE = MAX_CALL_STACK_FRAMES * EBPF_SUBPROGRAM_STACK_SIZE; +#define EBPF_TOTAL_STACK_SIZE (MAX_CALL_STACK_FRAMES * EBPF_SUBPROGRAM_STACK_SIZE)