get_route_to: the FRR enrichment gives an IPv6 prefix without a length /32 #64

Closed
opened 2026-11-02 07:46:33 +00:00 by christianmanivong · 0 comments
Owner

What happens

The FRR enrichment in get_route_to (napalm_linux/linux.py ~997, vtysh show ip route / show ipv6 route parsing) completes a prefix without a length as IPv4:

if "/" not in prefix:
    prefix += "/32"

An IPv6 prefix without a length (a host route) becomes 2001:db8::1/32 — a different, much larger prefix — so the enrichment either misses the matching ip route entry (stored as /128 since #6) or creates a bogus /32 entry. #6 fixed the same mistake for the ip route path only.

Expected

/32 for IPv4, /128 for IPv6 (by ipaddress.ip_address(prefix).version), as _routes.py does since #6. Test-first: a vtysh line with an IPv6 host route without a length yields /128.

Priority: P4 — wrong prefix for IPv6 host routes learned from FRR.

Found during the bug sweep of 2026-11-02.

## What happens The FRR enrichment in `get_route_to` (`napalm_linux/linux.py` ~997, vtysh `show ip route` / `show ipv6 route` parsing) completes a prefix without a length as IPv4: ```python if "/" not in prefix: prefix += "/32" ``` An IPv6 prefix without a length (a host route) becomes `2001:db8::1/32` — a different, much larger prefix — so the enrichment either misses the matching `ip route` entry (stored as `/128` since #6) or creates a bogus `/32` entry. #6 fixed the same mistake for the `ip route` path only. ## Expected `/32` for IPv4, `/128` for IPv6 (by `ipaddress.ip_address(prefix).version`), as `_routes.py` does since #6. Test-first: a vtysh line with an IPv6 host route without a length yields `/128`. Priority: P4 — wrong prefix for IPv6 host routes learned from FRR. Found during the bug sweep of 2026-11-02.
christianmanivong added the
prio
P4
bug
labels 2026-11-02 07:46:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-linux#64