-
-
Save TCY16/d72b1fbad14dca8136632ae9db5b91a5 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; | |
struct in6_addr ipv6_addr; | |
} key6 = { | |
.prefixlen = 64, | |
.ipv6_addr = *key | |
}; | |
uint64_t *count = bpf_map_lookup_elem(&exclude_v6_prefixes, &key6); | |
// if the prefix is 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