redirect seen as error

Bug #1972897 reported by Martijn Lievaart
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
iputils (Ubuntu)
New
Undecided
Unassigned

Bug Description

NOTE: this bug report is for the package iputils-ping, but the website did not let me enter that:
$ dpkg-query -S /bin/ping
iputils-ping: /bin/ping
$ dpkg-query -l iputils-ping
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-===============================================
ii iputils-ping 3:20211215-1 amd64 Tools to test the reachability of network hosts
$

This is on 22.04 (Jammy Jellyfish), but the bug is also present in 20.04 (Focal Fossa)

The deadline option is documented to exit on receiving an ICMP error:

       -w deadline
           Specify a timeout, in seconds, before ping exits regardless of how many packets have been sent or received. In this case ping does not stop after count packet are sent, it waits
           either for deadline expire or until count probes are answered or for some error notification from network.

However, it exits too when a redirect is received, which is not an error. This make it useless for liveness probes when a redirect occurs.

$ ping -w 2 strange.soleus.nu
PING strange.soleus.nu (94.142.246.148) 56(84) bytes of data.
From hv02.rtij.nl (10.0.2.4) icmp_seq=1 Redirect Host(New nexthop: lte.rtij.nl (10.0.0.137))

--- strange.soleus.nu ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
$

Note that the -c <n> option suffers from the same problem.

This does not happen in 18.04 (Bionic Beaver), which shows the expected behaviour:

martijn@popeye:~$ ping -w 2 strange.soleus.nu
PING strange.soleus.nu (94.142.246.148) 56(84) bytes of data.
From hv02.rtij.nl (10.0.2.4): icmp_seq=1 Redirect Host(New nexthop: lte.rtij.nl (10.0.0.137))
64 bytes from strange.soleus.nu (94.142.246.148): icmp_seq=1 ttl=53 time=47.9 ms

--- strange.soleus.nu ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 47.908/47.908/47.908/0.000 ms
martijn@popeye:~$ grep VERSION /etc/os-release
VERSION="18.04.6 LTS (Bionic Beaver)"
VERSION_ID="18.04"
VERSION_CODENAME=bionic
martijn@popeye:~$ dpkg-query -S /bin/ping
iputils-ping: /bin/ping
martijn@popeye:~$

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.