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 b4fd5ea commit 3ae853a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/ebpf-c/xdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,15 @@ int xdp_durdur_func(struct xdp_md *ctx)
struct iphdr *ip = data + sizeof(struct ethhdr);

__u32 ip_src = ip->saddr;
printk("IP %s", &ip_src);
long *pkt_count = bpf_map_lookup_elem(&drop_src_addrs, &ip_src);
if (pkt_count)
{
__sync_fetch_and_add(pkt_count, 1);
return XDP_DROP;
}


if (ip->protocol == IPPROTO_UDP)
{
struct udphdr *udp;
Expand Down

0 comments on commit 3ae853a

Please sign in to comment.