feat(xdp): IPv6 parity — blacklist6_map, v6 bans, v6 prefix stats

- C: lpm_key6 + blacklist6_map (LPM_TRIE, 20-byte key); native IPv6 no
  longer returns XDP_PASS before filtering: same L4/port gates, then
  blacklist6, UDP drop-policy, TCP flag checks and /64 prefix stats.
- Rust: blacklist6_key/blacklist6_update; ban_cidr handles V4 and V6;
  gateway xdp_ban uses ban_cidr (/32 or /128); dead ban_ip removed.
- tests/xdp_ban_v6.rs (key layout) and scripts/xdp_ipv6_smoke.sh
  (real kernel: pass -> ban drops -> unban passes).
- TODO: record done items and two findings (userspace ban expiry clock
  mismatch; short-L4 bypass of blacklist).
This commit is contained in:
Loki 2026-11-15 23:02:12 +01:00
parent cacd01c657
commit 59d5a088b2
Signed by: boba
GPG key ID: 6CDE87BC9A778D97
11 changed files with 309 additions and 36 deletions

View file

@ -50,6 +50,12 @@ struct lpm_key {
__u32 ip;
};
// ── LPM key for IPv6 blacklist (format of bpf_lpm_trie_key, 20 bytes) ──
struct lpm_key6 {
__u32 prefixlen;
__u8 addr[16];
};
// ── Ringbuf event (userspace receives these) ──
enum event_type {
EVENT_BAN = 0,