Add support for bpf_loop().

This commit is contained in:
Christian Deacon
2025-03-27 20:36:20 -04:00
parent 6001428130
commit 148385b3e7
4 changed files with 399 additions and 307 deletions

View File

@@ -13,7 +13,7 @@
// The maximum amount of filters allowed.
// Decrease this value if you receive errors related to the BPF program being too large.
#define MAX_FILTERS 60
#define MAX_FILTERS 1000
// Feel free to comment this out if you don't want the `blocked` entry on the stats map to be incremented every single time a packet is dropped from the source IP being on the blocked map.
// Commenting this line out should increase performance when blocking malicious traffic.
@@ -53,4 +53,8 @@
// Enables IPv6.
// If you're not using IPv6, this will speed up performance of the XDP program.
#define ENABLE_IPV6
#define ENABLE_IPV6
// If enabled, uses a newer bpf_loop() function when choosing a source port for a new connection.
// This allows for a much higher source port range. However, it requires a more recent kernel.
#define USE_NEW_LOOP