Skip to content

Instantly share code, notes, and snippets.

View raffysommy's full-sized avatar

Raffaele Sommese raffysommy

View GitHub Profile
@summerwind
summerwind / xdp_load_balancer.c
Last active January 30, 2023 15:04
XDP based load balancer with L3DSR support
#define KBUILD_MODNAME "load_balancer"
#include <uapi/linux/bpf.h>
#include <linux/in.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
#include <linux/if_vlan.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
BPF_HASH(counter, uint32_t, long);