Skip to content

Commit

Permalink
Merge pull request #74 from OpenCloudOS/dev
Browse files Browse the repository at this point in the history
fix some compiling error in compat mode
  • Loading branch information
menglongdong authored Oct 8, 2023
2 parents 1e2c0ff + 98d1836 commit cea53aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion shared/bpf/skb_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#define bpf_core_type_exists(type) false

#undef bpf_core_field_exists
#define bpf_core_field_exists(field) false
#define bpf_core_field_exists(field...) false

#undef bpf_core_enum_value_exists
#define bpf_core_enum_value_exists(value) false
Expand Down
2 changes: 2 additions & 0 deletions shared/bpf/skb_parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ static try_inline int probe_parse_ip(void *ip, parse_ctx_t *ctx)
return -1;
}

#if !defined(COMPAT_MODE) || defined(BPF_FEAT_SK_PRPTOCOL_LEGACY)
static __always_inline u8 sk_get_protocol(struct sock *sk)
{
u32 flags = _(((u32 *)(&sk->__sk_flags_offset))[0]);
Expand All @@ -344,6 +345,7 @@ static __always_inline u8 sk_get_protocol(struct sock *sk)
#endif
return l4_proto;
}
#endif

static try_inline int __probe_parse_sk(parse_ctx_t *ctx)
{
Expand Down

0 comments on commit cea53aa

Please sign in to comment.