Open Integral-Tech opened 2 weeks ago
struct bpf_lpm_trie_key
struct bpf_lpm_trie_key_u8
struct bpf_lpm_trie_key_hdr
Since the data member in struct bpf_lpm_trie_key is unused in dae, struct bpf_lpm_trie_key_hdr is obviously a better option. By using the new struct bpf_lpm_trie_key_hdr, the following code in dae should be changed:
data
diff --git a/control/kern/tproxy.c b/control/kern/tproxy.c index 2eb6471..be0d198 100644 --- a/control/kern/tproxy.c +++ b/control/kern/tproxy.c @@ -241,7 +241,7 @@ struct { // Array of LPM tries: struct lpm_key {
@@ -888,15 +888,15 @@ static __always_inline __s64 route(const struct route_params *params) (ctx.h_dport == 53 && _l4proto_type == L4ProtoType_UDP) << 3;
struct lpm_key lpm_key_saddr = {
你是不是在说这个:https://github.com/daeuniverse/dae/issues/482
没细看你的方案,但是如果是一个在新旧内核都能 CORE 的做法,那非常好!
struct bpf_lpm_trie_key
has been deprecated since kernel 6.9. It is recommended to usestruct bpf_lpm_trie_key_u8
(when the "data" member is needed for byte access) orstruct bpf_lpm_trie_key_hdr
(when using an alternative type for the trailing flexible array member) instead.Since the
data
member instruct bpf_lpm_trie_key
is unused in dae,struct bpf_lpm_trie_key_hdr
is obviously a better option. By using the newstruct bpf_lpm_trie_key_hdr
, the following code in dae should be changed:@@ -888,15 +888,15 @@ static __always_inline __s64 route(const struct route_params *params) (ctx.h_dport == 53 && _l4proto_type == L4ProtoType_UDP) << 3;