ping got confused about IP-adress after host unreachable

Bug #1471230 reported by Ketil
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
iputils (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I tried pinging an IP address on an internal network. My IP is 10.0.0.95, and I'm trying to ping 10.0.0.96. Here's what it looked like:

$ ping 10.0.0.96
PING 10.0.0.96 (10.0.0.96) 56(84) bytes of data.
From 10.0.0.95 icmp_seq=1 Destination Host Unreachable
From 10.0.0.95 icmp_seq=2 Destination Host Unreachable
From 10.0.0.95 icmp_seq=3 Destination Host Unreachable
From 10.0.0.95 icmp_seq=4 Destination Host Unreachable
From 10.0.0.95 icmp_seq=5 Destination Host Unreachable
From 10.0.0.95 icmp_seq=6 Destination Host Unreachable
From 10.0.0.95 icmp_seq=7 Destination Host Unreachable
From 10.0.0.95 icmp_seq=8 Destination Host Unreachable
From 10.0.0.95 icmp_seq=9 Destination Host Unreachable
From 10.0.0.95 icmp_seq=10 Destination Host Unreachable
From 10.0.0.95 icmp_seq=11 Destination Host Unreachable
From 10.0.0.95 icmp_seq=12 Destination Host Unreachable
64 bytes from 10.0.0.95: icmp_seq=13 ttl=64 time=5.01ms
64 bytes from 10.0.0.95: icmp_seq=14 ttl=64 time=0.658ms
64 bytes from 10.0.0.95: icmp_seq=15 ttl=64 time=0.459ms
64 bytes from 10.0.0.95: icmp_seq=16 ttl=64 time=0.432ms
64 bytes from 10.0.0.95: icmp_seq=17 ttl=64 time=0.437ms
64 bytes from 10.0.0.95: icmp_seq=18 ttl=64 time=0.348ms
64 bytes from 10.0.0.95: icmp_seq=19 ttl=64 time=0.485ms
64 bytes from 10.0.0.95: icmp_seq=20 ttl=64 time=0.529ms
64 bytes from 10.0.0.95: icmp_seq=21 ttl=64 time=0.459ms
[snip]
^C
--- 10.0.0.96 ping statistics ---
47 packets transmitted, 35 received, +12 errors, 25% packet loss, time 46069ms
rtt min/avg/max/mdev = 0.348/2.693/70.753/11.712 ms, pipe 3
$ ping 10.0.0.96
PING 10.0.0.96 (10.0.0.96) 56(84) bytes of data.
64 bytes from 10.0.0.96: icmp_seq=1 ttl=64 time=0.324ms
64 bytes from 10.0.0.96: icmp_seq=2 ttl=64 time=0.405ms
64 bytes from 10.0.0.96: icmp_seq=1 ttl=64 time=0.357ms
etc...

So on the initial run, ping claims it got a ping reply from 10.0.0.95, which isn't the address I'm pinging. It's my host, and it's normal to get the initial ICMP "Destination Host Unreachable" messages from the local IP when ARP fails. I almost immediately reran ping, and now the host was up from the start, and see responses coming from the actual host that I'm pinging.

Looking at the times, the ping replies appear to actually come from 10.0.0.96, or at least some other remote host, based on the time values. If I ping 10.0.0.95 (my own IP), I'm seeing time values of 0.040ms or thereabouts, so an order of magnitude faster.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: iputils-ping 3:20121221-4ubuntu1.1
Uname: Linux 3.17.1-031701-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.11
Architecture: amd64
CurrentDesktop: Unity
Date: Fri Jul 3 15:16:40 2015
InstallationDate: Installed on 2014-10-09 (266 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2)
SourcePackage: iputils
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Ketil (ketil-froyn) wrote :
Revision history for this message
Ketil (ketil-froyn) wrote :

I see I've made a typo regarding icmp_seq in the output of the second run of ping (icmp_seq 1, then 2, and then 1 again, but the last one should be 3). I typed this manually, so there may be other typos as well. But I can't see any typos regarding the main point, I got the ping replies from my own IP address, with times on the order of 0.400ms.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in iputils (Ubuntu):
status: New → Confirmed
Revision history for this message
Vee Tornado (gk-v-z1) wrote :

I was about to enter a new bug report, but came across yours Ketil. Have same issue.

The reported source address from the ping reply is wrong when an intermediary router sent an icmp-host-unreachable, after which the destination host becomes reachable and starts replying.

In that case the reported source address is that from the intermediary router (or the originating host itself) that sent the icmp-host-unreachable, and not of the destination host that sent the icmp-echo-reply, as it should be.

v@p8p67:~$ ping -n 172.31.168.107
PING 172.31.168.107 (172.31.168.107) 56(84) bytes of data.
From 172.31.168.161 icmp_seq=1 Destination Host Unreachable
From 172.31.168.161 icmp_seq=2 Destination Host Unreachable
From 172.31.168.161 icmp_seq=3 Destination Host Unreachable
64 bytes from 172.31.168.161: icmp_seq=4 ttl=64 time=7.46 ms
64 bytes from 172.31.168.161: icmp_seq=5 ttl=64 time=3.26 ms
64 bytes from 172.31.168.161: icmp_seq=6 ttl=64 time=3.41 ms
...

Obviously the last three lines should start with 64 bytes from 172.31.168.107... and not .161.

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.