-
-
Save TCY16/64fb84de3e0253d3c7a516ee0b3043aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// search for the prefix in the LPM trie | |
struct { | |
uint32_t prefixlen; | |
uint32_t ipv4_addr; | |
} key4 = { | |
.prefixlen = 32, | |
.ipv4_addr = key | |
}; | |
uint64_t *count = bpf_map_lookup_elem(&exclude_v4_prefixes, &key4); | |
// if the prefix matches, we exclude it from rate limiting | |
if (count) { | |
lock_xadd(count, 1); | |
return 1; // XDP_PASS | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment