Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
boratanrikulu committed Jul 27, 2024
1 parent 3ae853a commit 6ac5fbd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/ebpf-c/xdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down

0 comments on commit 6ac5fbd

Please sign in to comment.