Revert "Switch to using typesafe kernel ebpf map accessors"
This reverts commit d07962a3f6d6a9c3f63a12b7cfd8c486cd7c78e3.
diff --git a/bpf_progs/clatd.c b/bpf_progs/clatd.c
index 578d244..4c2953f 100644
--- a/bpf_progs/clatd.c
+++ b/bpf_progs/clatd.c
@@ -48,7 +48,12 @@
#define ntohs(x) htons(x)
#define ntohl(x) htonl(x)
-DEFINE_BPF_MAP(clat_ingress_map, HASH, ClatIngressKey, ClatIngressValue, 16)
+struct bpf_map_def SEC("maps") clat_ingress_map = {
+ .type = BPF_MAP_TYPE_HASH,
+ .key_size = sizeof(struct ClatIngressKey),
+ .value_size = sizeof(struct ClatIngressValue),
+ .max_entries = 16,
+};
static inline __always_inline int nat64(struct __sk_buff* skb, bool is_ethernet) {
const int l2_header_size = is_ethernet ? sizeof(struct ethhdr) : 0;
@@ -87,7 +92,7 @@
return TC_ACT_OK;
}
- ClatIngressKey k = {
+ struct ClatIngressKey k = {
.iif = skb->ifindex,
.pfx96.in6_u.u6_addr32 =
{
@@ -98,7 +103,7 @@
.local6 = ip6->daddr,
};
- ClatIngressValue* v = bpf_clat_ingress_map_lookup_elem(&k);
+ struct ClatIngressValue* v = bpf_map_lookup_elem(&clat_ingress_map, &k);
if (!v) return TC_ACT_OK;