Handle an announcement without an origin like a replacement (closes #113) #138

Merged
clawbot merged 1 commits from issue-113-no-origin-announcement into next 2026-10-20 03:25:43 +02:00
Collaborator

Fixes #113.

An announcement whose AS path is empty or ends in AS 0 now deletes the peer's route for the prefix, as a withdrawal does. A peer's new announcement for a prefix replaces its old route; when the new path gives nothing to store, the old route is replaced with none. Before, such an announcement was neither stored nor applied: the peer's old route stayed live with its old origin and path, and when it followed the peer's withdrawal of the prefix in the same batch, the withdrawal was lost, because a batch keeps only each peer's last update for a prefix.

The change is one branch in the batch flush: every update that is not a storable announcement goes to the deletions. A path ending in an AS set of several members is still stored, with origin 0.

Not shown by the diff: such an announcement still counts as an announcement in the metrics, which count what the feed sent, and its prefix is still recorded in the prefix tables, as a withdrawn prefix is.

Disclosures:

  • Extra file: README.md "Handler Details" names the new deletion case.
  • Not covered: a path with AS 0 before its last AS, such as [64496, 0, 64497], is still stored with origin 64497, although RFC 7607 treats any AS 0 in a path as a withdrawal; the issue names only the origin.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/routewatch/issues/113. An announcement whose AS path is empty or ends in AS 0 now deletes the peer's route for the prefix, as a withdrawal does. A peer's new announcement for a prefix replaces its old route; when the new path gives nothing to store, the old route is replaced with none. Before, such an announcement was neither stored nor applied: the peer's old route stayed live with its old origin and path, and when it followed the peer's withdrawal of the prefix in the same batch, the withdrawal was lost, because a batch keeps only each peer's last update for a prefix. The change is one branch in the batch flush: every update that is not a storable announcement goes to the deletions. A path ending in an AS set of several members is still stored, with origin 0. Not shown by the diff: such an announcement still counts as an announcement in the metrics, which count what the feed sent, and its prefix is still recorded in the prefix tables, as a withdrawn prefix is. Disclosures: - Extra file: `README.md` "Handler Details" names the new deletion case. - Not covered: a path with AS 0 before its last AS, such as `[64496, 0, 64497]`, is still stored with origin 64497, although RFC 7607 treats any AS 0 in a path as a withdrawal; the issue names only the origin. Model: opus-5-5
clawbot added the needs-review label 2026-10-20 03:05:42 +02:00
clawbot self-assigned this 2026-10-20 03:05:42 +02:00
Author
Collaborator
  1. internal/routewatch/prefixhandler.go, PrefixHandler.flushBatch: the deletion branch now also takes announcements whose AS path is empty or ends in AS 0, but its error for a prefix that does not parse still says "Failed to parse CIDR for withdrawal". An announcement of such a prefix with the path [64496, 0] is logged as a withdrawal the feed never sent. Acceptable: a message that is true for both kinds of update, such as "Failed to parse CIDR for route deletion", or one that logs the update's type.

Model: opus-5-5

1. `internal/routewatch/prefixhandler.go`, `PrefixHandler.flushBatch`: the deletion branch now also takes announcements whose AS path is empty or ends in AS 0, but its error for a prefix that does not parse still says "Failed to parse CIDR for withdrawal". An announcement of such a prefix with the path `[64496, 0]` is logged as a withdrawal the feed never sent. Acceptable: a message that is true for both kinds of update, such as "Failed to parse CIDR for route deletion", or one that logs the update's type. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-20 03:16:34 +02:00
clawbot added 1 commit 2026-10-20 03:19:43 +02:00
An announcement whose AS path is empty or ends in AS 0 now deletes the
peer's route for the prefix, as a withdrawal does. Before, it was neither
stored nor applied: the peer's old route stayed live, and within one
batch it cancelled the peer's earlier withdrawal of the prefix.

Model: opus-5-5
clawbot force-pushed issue-113-no-origin-announcement from dfca772035 to e02267a659 2026-10-20 03:19:43 +02:00 Compare
Author
Collaborator
  1. The deletion branch in PrefixHandler.flushBatch now logs "Failed to parse CIDR for route deletion", which is true for both a withdrawal and an announcement without a usable origin.

Model: opus-5-5

1. The deletion branch in `PrefixHandler.flushBatch` now logs "Failed to parse CIDR for route deletion", which is true for both a withdrawal and an announcement without a usable origin. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-20 03:19:50 +02:00
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 467c295f94 into next 2026-10-20 03:25:43 +02:00
clawbot deleted branch issue-113-no-origin-announcement 2026-10-20 03:25:43 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#138