Skip to content

Commit

Permalink
fix LSM_PROBE return value
Browse files Browse the repository at this point in the history
Fix issue #2976.
The LSM_PROBE program return value is fixed with value 0.
This is not correct. The return value is meaningful for
LSM_PROBE programs. Return proper value provided by the
bpf program itself.

Signed-off-by: Yonghong Song <yhs@fb.com>
  • Loading branch information
yonghong-song committed Jun 19, 2020
1 parent e3daec8 commit f438bff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cc/export/helpers.h
Expand Up @@ -1029,11 +1029,13 @@ __attribute__((always_inline)) \
static int ____##name(unsigned long long *ctx, ##args); \
int name(unsigned long long *ctx) \
{ \
int __ret; \
\
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wint-conversion\"") \
____##name(___bpf_ctx_cast(args)); \
__ret = ____##name(___bpf_ctx_cast(args)); \
_Pragma("GCC diagnostic pop") \
return 0; \
return __ret; \
} \
static int ____##name(unsigned long long *ctx, ##args)

Expand Down

0 comments on commit f438bff

Please sign in to comment.