Where: PrefixHandler.flushBatch and canonicalPrefix in internal/routewatch/prefixhandler.go; UpdatePrefixesBatch and insertPrefixesInTable in internal/database/database.go.
canonicalPrefix returns a prefix that does not parse unchanged, and flushBatch adds every update's prefix to prefixesToUpdate before the route branches reject it (createLiveRoute logs "Failed to parse CIDR" and stores no route; the withdrawal branch logs and skips). UpdatePrefixesBatch then sorts the string into prefixes_v4 or prefixes_v6 by whether it contains a colon and inserts it without validation, and the in-memory prefix count shown by /status.json and /api/v1/stats goes up by one. Nothing ever deletes prefixes rows.
Scenario: a feed line carries "prefixes":["not-a-prefix"] (or a withdrawal of such a string, or an empty string). The route tables stay clean, but prefixes_v4 gains a permanent row not-a-prefix and the public prefix total counts it. RIS Live's prefixes come from decoded BGP NLRI and are well-formed in practice, so this needs a malformed or hostile feed; the effect is junk rows and inflated counts, one error log line per occurrence.
Severity: low.
Definition of done
canonicalPrefix reports failure and HandleMessage drops (and counts) an update whose prefix does not parse, so it never reaches prefixesToUpdate; or UpdatePrefixesBatch validates with netip.ParsePrefix before inserting.
Test, failing before the fix: handle an announcement for not-a-prefix and a withdrawal for also/bad, flush; SELECT COUNT(*) FROM prefixes_v4 is 0 and the stats prefix count is unchanged (today two rows and a count of 2).
make check passes.
Model: fable-5-1
Where: `PrefixHandler.flushBatch` and `canonicalPrefix` in `internal/routewatch/prefixhandler.go`; `UpdatePrefixesBatch` and `insertPrefixesInTable` in `internal/database/database.go`.
`canonicalPrefix` returns a prefix that does not parse unchanged, and `flushBatch` adds every update's prefix to `prefixesToUpdate` before the route branches reject it (`createLiveRoute` logs "Failed to parse CIDR" and stores no route; the withdrawal branch logs and skips). `UpdatePrefixesBatch` then sorts the string into `prefixes_v4` or `prefixes_v6` by whether it contains a colon and inserts it without validation, and the in-memory prefix count shown by `/status.json` and `/api/v1/stats` goes up by one. Nothing ever deletes prefixes rows.
Scenario: a feed line carries `"prefixes":["not-a-prefix"]` (or a withdrawal of such a string, or an empty string). The route tables stay clean, but `prefixes_v4` gains a permanent row `not-a-prefix` and the public prefix total counts it. RIS Live's prefixes come from decoded BGP NLRI and are well-formed in practice, so this needs a malformed or hostile feed; the effect is junk rows and inflated counts, one error log line per occurrence.
Severity: low.
## Definition of done
- `canonicalPrefix` reports failure and `HandleMessage` drops (and counts) an update whose prefix does not parse, so it never reaches `prefixesToUpdate`; or `UpdatePrefixesBatch` validates with `netip.ParsePrefix` before inserting.
- Test, failing before the fix: handle an announcement for `not-a-prefix` and a withdrawal for `also/bad`, flush; `SELECT COUNT(*) FROM prefixes_v4` is 0 and the stats prefix count is unchanged (today two rows and a count of 2).
- `make check` passes.
Model: fable-5-1
clawbot
self-assigned this 2026-10-19 22:35:23 +02:00
#142: the prefix handler logs and drops an announcement or withdrawal whose prefix does not parse, so it never reaches the prefix tables or the prefix count. This takes the first fix the definition of done offers; UpdatePrefixesBatch is unchanged, and no counter was added for dropped prefixes beyond the error log line.
Model: opus-5-5
https://git.eeqj.de/sneak/routewatch/pulls/142: the prefix handler logs and drops an announcement or withdrawal whose prefix does not parse, so it never reaches the prefix tables or the prefix count. This takes the first fix the definition of done offers; `UpdatePrefixesBatch` is unchanged, and no counter was added for dropped prefixes beyond the error log line.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Where:
PrefixHandler.flushBatchandcanonicalPrefixininternal/routewatch/prefixhandler.go;UpdatePrefixesBatchandinsertPrefixesInTableininternal/database/database.go.canonicalPrefixreturns a prefix that does not parse unchanged, andflushBatchadds every update's prefix toprefixesToUpdatebefore the route branches reject it (createLiveRoutelogs "Failed to parse CIDR" and stores no route; the withdrawal branch logs and skips).UpdatePrefixesBatchthen sorts the string intoprefixes_v4orprefixes_v6by whether it contains a colon and inserts it without validation, and the in-memory prefix count shown by/status.jsonand/api/v1/statsgoes up by one. Nothing ever deletes prefixes rows.Scenario: a feed line carries
"prefixes":["not-a-prefix"](or a withdrawal of such a string, or an empty string). The route tables stay clean, butprefixes_v4gains a permanent rownot-a-prefixand the public prefix total counts it. RIS Live's prefixes come from decoded BGP NLRI and are well-formed in practice, so this needs a malformed or hostile feed; the effect is junk rows and inflated counts, one error log line per occurrence.Severity: low.
Definition of done
canonicalPrefixreports failure andHandleMessagedrops (and counts) an update whose prefix does not parse, so it never reachesprefixesToUpdate; orUpdatePrefixesBatchvalidates withnetip.ParsePrefixbefore inserting.not-a-prefixand a withdrawal foralso/bad, flush;SELECT COUNT(*) FROM prefixes_v4is 0 and the stats prefix count is unchanged (today two rows and a count of 2).make checkpasses.Model: fable-5-1
#142: the prefix handler logs and drops an announcement or withdrawal whose prefix does not parse, so it never reaches the prefix tables or the prefix count. This takes the first fix the definition of done offers;
UpdatePrefixesBatchis unchanged, and no counter was added for dropped prefixes beyond the error log line.Model: opus-5-5