IP lookup can name the AS of a default or near-default route as an address's owner #57

Closed
opened 2026-10-14 14:35:04 +02:00 by clawbot · 1 comment
Collaborator

An IP lookup can name the AS of a default or near-default route as the owner of an address.

Where: GetIPInfoContext in internal/database/database.go: the lookup tries every mask length down to /0, so any covering route counts, however short.

Seen on the live feed (image built from next at 00e51d2, two minutes after start): one RIS peer announces 2000::/3 with origin AS24785. Until a more specific route for an address has been seen, GET /api/v1/ip/2001:4860:4860::8888 and GET /api/v1/ip/2606:4700:4700::1111 both answered AS24785 ("Broadband Hosting B.V."), not AS15169 and AS13335. The table only learns a route when a peer sends an update for it, so for a stable prefix this can last for hours. A peer that sends 0.0.0.0/0 or ::/0 does the same for every address.

A default route or a route this short only says where a peer sends traffic it has no better route for; it does not say who holds the address.

Severity: medium

Definition of done

  • The IP lookup (/api/v1/ip/... and /ip/...) ignores routes shorter than a minimum mask length, named constants: /8 for IPv4 and /16 for IPv6. An address covered only by shorter routes gets the existing "no route found" answer. The live tables keep storing such routes; only the lookup skips them.
  • A test that fails before the fix: with only 2000::/3 and 0.0.0.0/0 in the table, lookups of an IPv6 and an IPv4 address find no route; with a /32 added, the IPv6 lookup finds it.
  • README, where it describes the IP lookup, says in one line that routes shorter than those lengths are not used.
  • make check passes.

Model: opus-5-5

An IP lookup can name the AS of a default or near-default route as the owner of an address. Where: `GetIPInfoContext` in `internal/database/database.go`: the lookup tries every mask length down to `/0`, so any covering route counts, however short. Seen on the live feed (image built from `next` at `00e51d2`, two minutes after start): one RIS peer announces `2000::/3` with origin AS24785. Until a more specific route for an address has been seen, `GET /api/v1/ip/2001:4860:4860::8888` and `GET /api/v1/ip/2606:4700:4700::1111` both answered AS24785 ("Broadband Hosting B.V."), not AS15169 and AS13335. The table only learns a route when a peer sends an update for it, so for a stable prefix this can last for hours. A peer that sends `0.0.0.0/0` or `::/0` does the same for every address. A default route or a route this short only says where a peer sends traffic it has no better route for; it does not say who holds the address. Severity: medium ## Definition of done - The IP lookup (`/api/v1/ip/...` and `/ip/...`) ignores routes shorter than a minimum mask length, named constants: `/8` for IPv4 and `/16` for IPv6. An address covered only by shorter routes gets the existing "no route found" answer. The live tables keep storing such routes; only the lookup skips them. - A test that fails before the fix: with only `2000::/3` and `0.0.0.0/0` in the table, lookups of an IPv6 and an IPv4 address find no route; with a `/32` added, the IPv6 lookup finds it. - README, where it describes the IP lookup, says in one line that routes shorter than those lengths are not used. - `make check` passes. Model: opus-5-5
clawbot self-assigned this 2026-10-14 14:35:04 +02:00
Author
Collaborator

Implemented in #59: the IP lookup now stops at /8 for IPv4 and /16 for IPv6, so an address covered only by shorter routes gets "no route found"; those routes are still stored.

Model: opus-5-5

Implemented in https://git.eeqj.de/sneak/routewatch/pulls/59: the IP lookup now stops at /8 for IPv4 and /16 for IPv6, so an address covered only by shorter routes gets "no route found"; those routes are still stored. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#57