Treat a path with AS 0 anywhere as a withdrawal (closes #141) #146

Merged
clawbot merged 1 commits from issue-141-as-zero into next 2026-10-20 04:07:42 +02:00
Collaborator

An AS path that holds AS 0 anywhere, a member of an AS set included, now decodes as an empty path (ASPath.UnmarshalJSON in internal/ristypes/ris.go). RFC 7607 makes such a path malformed and its announcements withdrawals.

The check sits in the decoder because all three handlers already handle an empty path the right way: the prefix handler deletes the peer's route for the prefix (the rule from #113), the AS handler has no AS to record, and the peering handler needs at least two. No handler code changes; the prefix handler's comments and the README now say "holds AS 0 anywhere" where they said "ends in AS 0". The decoding moved into decodeASPath so that the check runs once, after both the plain and the AS-set decoding.

What the diff does not show: a message built in Go rather than decoded (only tests do that) keeps AS 0 in its path. The existing prefix handler test that builds a path ending in AS 0 by hand still passes, because such a path gives no origin.

Disclosures:

  • The issue says the peering handler records peerings with AS 0; it already skipped those pairs, but recorded the other neighbours in such a path, so its test also uses a path with AS 0 after two ASes.
  • README.md changed (one sentence), outside the expected file list.

Model: opus-5-5

An AS path that holds AS 0 anywhere, a member of an AS set included, now decodes as an empty path (`ASPath.UnmarshalJSON` in `internal/ristypes/ris.go`). RFC 7607 makes such a path malformed and its announcements withdrawals. The check sits in the decoder because all three handlers already handle an empty path the right way: the prefix handler deletes the peer's route for the prefix (the rule from https://git.eeqj.de/sneak/routewatch/issues/113), the AS handler has no AS to record, and the peering handler needs at least two. No handler code changes; the prefix handler's comments and the README now say "holds AS 0 anywhere" where they said "ends in AS 0". The decoding moved into `decodeASPath` so that the check runs once, after both the plain and the AS-set decoding. What the diff does not show: a message built in Go rather than decoded (only tests do that) keeps AS 0 in its path. The existing prefix handler test that builds a path ending in AS 0 by hand still passes, because such a path gives no origin. Disclosures: - The issue says the peering handler records peerings with AS 0; it already skipped those pairs, but recorded the other neighbours in such a path, so its test also uses a path with AS 0 after two ASes. - `README.md` changed (one sentence), outside the expected file list. Model: opus-5-5
clawbot added the needs-review label 2026-10-20 04:01:31 +02:00
clawbot self-assigned this 2026-10-20 04:01:31 +02:00
clawbot added 1 commit 2026-10-20 04:01:32 +02:00
An AS path that holds AS 0 anywhere, a member of an AS set included, now
decodes as an empty path. RFC 7607 makes such a path malformed and its
announcements withdrawals. An empty path already gets that handling:
the prefix handler deletes the peer's route for the prefix, and the AS
and peering handlers record nothing from it. Before, a path such as
[64496, 0, 64497] stored the route with origin AS64497, recorded both
ASes, and recorded the peerings between the path's other ASes.

Model: opus-5-5
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 651a9e22f6 into next 2026-10-20 04:07:42 +02:00
clawbot deleted branch issue-141-as-zero 2026-10-20 04:07:42 +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#146