From 6ac5fbd5c3236ae1902cc9a6c757898d22c22e6d Mon Sep 17 00:00:00 2001 From: boratanrikulu Date: Sun, 28 Jul 2024 01:18:30 +0300 Subject: [PATCH] f --- internal/ebpf-c/xdp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/ebpf-c/xdp.c b/internal/ebpf-c/xdp.c index 757392a..9fd6739 100644 --- a/internal/ebpf-c/xdp.c +++ b/internal/ebpf-c/xdp.c @@ -117,11 +117,15 @@ int xdp_durdur_func(struct xdp_md *ctx) void *data = (void *)(long)ctx->data; void *data_end = (void *)(long)ctx->data_end; + printk("1"); + if (data + sizeof(struct ethhdr) + sizeof(struct iphdr) > data_end) { return XDP_PASS; } + printk("2"); + struct ethhdr *eth = data; if (eth->h_proto != bpf_htons(ETH_P_IP)) {