ping fails on BusyBox (Alpine) hosts; IPv6 probes are dropped #15

Open
opened 2026-10-06 17:31:30 +00:00 by christianmanivong · 0 comments
Owner

LinuxDriver.ping (napalm_linux/linux.py:914) expects the iputils summary:

(\d+) packets transmitted,\s*(\d+) received,\s*([\d.]+)% packet loss

BusyBox ping, the one on Alpine, prints 2 packets transmitted, 2 packets received, 0% packet loss. The extra "packets" breaks the match, so ping() returns {"error": …} for every target.

The ping sweep counts an error as "not alive" (napalm_device_types/ping_sweep.py:144). A LAN scan that runs through an Alpine host therefore reports every address as down.

Two smaller problems:

  • The per-probe regex (:947) is IPv4-only and requires ttl=, so IPv6 probes never appear in results.
  • The BusyBox rtt line (round-trip min/avg/max = …, no mdev) is not read.

Fix: accept the optional "packets" and both rtt formats, or use the shared parser proposed in NAPALM/napalm-device-types#12. Add tests with BusyBox and iputils output for IPv4 and IPv6.

Prio P3: LAN scans through Alpine hosts find nothing.

From the NetOrk function index (NetOrk/netork#670); every location was checked against the current code. Paths are relative to each driver repo.

`LinuxDriver.ping` (`napalm_linux/linux.py`:914) expects the iputils summary: ``` (\d+) packets transmitted,\s*(\d+) received,\s*([\d.]+)% packet loss ``` BusyBox ping, the one on Alpine, prints `2 packets transmitted, 2 packets received, 0% packet loss`. The extra "packets" breaks the match, so `ping()` returns `{"error": …}` for every target. The ping sweep counts an error as "not alive" (`napalm_device_types/ping_sweep.py`:144). A LAN scan that runs through an Alpine host therefore reports every address as down. Two smaller problems: - The per-probe regex (:947) is IPv4-only and requires `ttl=`, so IPv6 probes never appear in `results`. - The BusyBox rtt line (`round-trip min/avg/max = …`, no mdev) is not read. **Fix:** accept the optional "packets" and both rtt formats, or use the shared parser proposed in NAPALM/napalm-device-types#12. Add tests with BusyBox and iputils output for IPv4 and IPv6. Prio P3: LAN scans through Alpine hosts find nothing. From the NetOrk function index (NetOrk/netork#670); every location was checked against the current code. Paths are relative to each driver repo.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-linux#15