BBS: TELESC.NET.BR Assunto: ip.can / .can filter matching does not support IPv6 CIDR notation (web De: Rob Swindell Data: Fri, 22 May 2026 18:27:58 -0700 ----------------------------------------------------------- https://gitlab.synchro.net/main/sbbs/-/issues/1145#note_9011 Fixed in commit eee438b0b on `master`. **Code** (`src/sbbs3/findstr.c`): - Added IPv6 parallel functions: `parse_ipv6_address` (via `inet_pton(AF_INET6, ...)`), `parse_ipv6_cidr`, and `is_ipv6_cidr_match` (byte-then-bit prefix compare). - `findstr_compare()` now dispatches to the right family by which one the input parsed as; `find2strs_in_list()` and `find2strs()` pre-parse both forms up-front into a small internal `findstr_ip_t`. Public API in `findstr.h` unchanged. - Two latent IPv4 bugs surfaced by the new test cases were fixed alongside: - `is_cidr_match()`'s `>> (32 - subnet)` is undefined behavior when `subnet == 0` (a 32-bit shift by 32); on x86 it modulo-32s and `/0` never matched anything except via exact host hit. Now guarded. - `parse_cidr()` returned `uint32_t` with `0` overloaded as both "parse failed" and "0.0.0.0", so the literal pattern `0.0.0.0/0` (the canonical "match-any IPv4") fell through to string-only matching. Changed to `bool` + out-param, matching the new IPv6 convention. **Tests** (`exec/tests/system/findstr.js`, new): 50+ assertions covering string-pattern features (exact, case-insensitive, `~`/`^`/`*` wildcards, `;` comment, `!` reverse-match), IPv4 CIDR (including `/0` and boundary stress), IPv6 exact + CIDR (`/32` through `/128`, with bit-boundary stress at `/33`), `!CIDR` reverse-match for both families, cross-family no-false-match, and malformed-pattern rejection. Silent pass under `jsexec exec/tests/system/findstr.js`; throws on failure. **Docs**: Updated [`config:filter_files`](https://wiki.synchro.net/config:filter_files) on the wiki split the former `IPv4 CIDR Notation` section into parallel `IPv4 CIDR Notation` and `IPv6 CIDR Notation` H4s, removed the "IPv6 CIDR notation is not supported at this time" line, added the `/0` correctness note to the IPv4 section, and added an "upgrading from v3.21" note about `ip.can` files carrying inert IPv6 entries written by the rate-limit auto-filter (now enforced correctly). *Authored by Claude (Claude Code), on behalf of @rswindell* n --- mSynchronetn hgVertrauen n hHome of Synchronet n gh[vert/cvs/bbs].synchro.net ----------------------------------------------------------- [Voltar]