Skip to content

Commit da36eea

Browse files
committed
core: fix compile error in COMPAT mode
Signed-off-by: Menglong Dong <imagedong@tencent.com>
1 parent 676d5c4 commit da36eea

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

shared/bpf/skb_macro.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646
#endif
4747

4848
#ifdef COMPAT_MODE
49-
#define bpf_core_helper_exist(name) \
50-
bpf_core_enum_value_exists(enum bpf_func_id, BPF_FUNC_##name)
49+
#define bpf_core_helper_exist(name) false
5150

5251
#undef bpf_core_type_exists
5352
#define bpf_core_type_exists(type) false
@@ -61,7 +60,8 @@
6160
#undef bpf_core_field_offset
6261
#define bpf_core_field_offset(type, field) offsetof(type, field)
6362
#else
64-
#define bpf_core_helper_exist(name) false
63+
#define bpf_core_helper_exist(name) \
64+
bpf_core_enum_value_exists(enum bpf_func_id, BPF_FUNC_##name)
6565
#endif
6666

6767
#endif

shared/bpf/skb_parse.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77
#ifndef _H_BPF_SKB_UTILS
88
#define _H_BPF_SKB_UTILS
99

10-
#undef bpf_core_type_exists
11-
#undef bpf_core_field_exists
12-
#undef bpf_core_enum_value_exists
13-
#undef bpf_core_field_offset
10+
#ifndef COMPAT_MODE
1411
#include <bpf/bpf_core_read.h>
12+
#endif
1513

1614
#include "skb_macro.h"
1715
#include "skb_shared.h"

0 commit comments

Comments
 (0)