get_route_to (napalm_linux/linux.py:958) reads ip -4 route show && ip -6 route show and takes the first word of every line as the destination (line 963):
dest_m=re.match(r"^(\S+)",line)
That is wrong for lines whose first word is the route type or a continuation:
unreachable 10.0.0.0/8 metric 1024, blackhole 192.0.2.0/24, prohibit …, throw … → destination unreachable/32, blackhole/32 (lines 972-973 append /32 to anything without a slash).
A multipath route prints its next hops on continuation lines (\tnexthop via 10.0.0.1 dev eth0 weight 1); after strip() each becomes a destination nexthop/32, and the parent line (default proto static metric 100) has no via, so it gets an empty next hop.
An IPv6 host route without a prefix length also gets /32 instead of /128.
(The IPv6 default route stored as 0.0.0.0/0 is #6.)
Expected
Route-type keywords are read as the type (skipped, or reported with the type), the destination is the next word; nexthop lines attach their gateways to the preceding route; host routes get /32 or /128 by family. Test-first with a captured ip route output containing unreachable, blackhole and a multipath default.
Priority: P4 — bogus prefixes in the routing table on hosts with such routes.
Found during the bug sweep of 2026-11-01.
## What happens
`get_route_to` (`napalm_linux/linux.py:958`) reads `ip -4 route show && ip -6 route show` and takes the first word of every line as the destination (line 963):
```python
dest_m = re.match(r"^(\S+)", line)
```
That is wrong for lines whose first word is the route type or a continuation:
- `unreachable 10.0.0.0/8 metric 1024`, `blackhole 192.0.2.0/24`, `prohibit …`, `throw …` → destination `unreachable/32`, `blackhole/32` (lines 972-973 append `/32` to anything without a slash).
- A multipath route prints its next hops on continuation lines (`\tnexthop via 10.0.0.1 dev eth0 weight 1`); after `strip()` each becomes a destination `nexthop/32`, and the parent line (`default proto static metric 100`) has no `via`, so it gets an empty next hop.
- An IPv6 host route without a prefix length also gets `/32` instead of `/128`.
(The IPv6 default route stored as `0.0.0.0/0` is #6.)
## Expected
Route-type keywords are read as the type (skipped, or reported with the type), the destination is the next word; `nexthop` lines attach their gateways to the preceding route; host routes get `/32` or `/128` by family. Test-first with a captured `ip route` output containing `unreachable`, `blackhole` and a multipath default.
Priority: P4 — bogus prefixes in the routing table on hosts with such routes.
Found during the bug sweep of 2026-11-01.
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.
What happens
get_route_to(napalm_linux/linux.py:958) readsip -4 route show && ip -6 route showand takes the first word of every line as the destination (line 963):That is wrong for lines whose first word is the route type or a continuation:
unreachable 10.0.0.0/8 metric 1024,blackhole 192.0.2.0/24,prohibit …,throw …→ destinationunreachable/32,blackhole/32(lines 972-973 append/32to anything without a slash).\tnexthop via 10.0.0.1 dev eth0 weight 1); afterstrip()each becomes a destinationnexthop/32, and the parent line (default proto static metric 100) has novia, so it gets an empty next hop./32instead of/128.(The IPv6 default route stored as
0.0.0.0/0is #6.)Expected
Route-type keywords are read as the type (skipped, or reported with the type), the destination is the next word;
nexthoplines attach their gateways to the preceding route; host routes get/32or/128by family. Test-first with a capturedip routeoutput containingunreachable,blackholeand a multipath default.Priority: P4 — bogus prefixes in the routing table on hosts with such routes.
Found during the bug sweep of 2026-11-01.