ping possible bug ("-I" option)

Javier Viguera javier.viguera at digi.com
Thu Jul 16 07:39:22 UTC 2009



Denys Vlasenko wrote:
> Yes, it's normal.
> 
> Think about it. When you ping *yourself*,
> do ping packets really go over the physical wire?
> 
> Of course not. They exist only inside your computer.
> 
> In other words, they go over _loopback interface_!
> 
> Proof:
> 
> # ip a
> 1: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
>     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>     inet 127.0.0.1/8 scope host lo
>     inet6 ::1/128 scope host
>        valid_lft forever preferred_lft forever
> 2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
>     link/ether 00:1d:7d:c2:ec:70 brd ff:ff:ff:ff:ff:ff
>     inet 10.0.0.1/24 brd 10.0.0.255 scope global if
> 
> # ./busybox ping -I eth0 10.0.0.1
> PING 10.0.0.1 (10.0.0.1): 56 data bytes
> ^C
> --- 10.0.0.1 ping statistics ---
> 2 packets transmitted, 0 packets received, 100% packet loss
> 
> # ./busybox ping -I lo 10.0.0.1
> PING 10.0.0.1 (10.0.0.1): 56 data bytes
> 64 bytes from 10.0.0.1: seq=0 ttl=64 time=0.089 ms
> 64 bytes from 10.0.0.1: seq=1 ttl=64 time=0.064 ms
> 64 bytes from 10.0.0.1: seq=2 ttl=64 time=0.065 ms
> ^C
> --- 10.0.0.1 ping statistics ---
> 3 packets transmitted, 3 packets received, 0% packet loss
> round-trip min/avg/max = 0.064/0.072/0.089 ms
> 
> 
> --
> vda

Hi Denis.

Makes sense what you say, i understand now.

One minor thing, though.

It seems that the "normal" ping from my PC (iputils-ping package - 
Ubuntu Hardy) does show the echo replies, while busybox ping does not 
show them:

My eth1 is 192.168.105.1

busybox.git$ sudo ./busybox -I eth1 192.168.105.1
PING 192.168.105.1 (192.168.105.1): 56 data bytes

--- 192.168.105.1 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss

busybox.git$ ping -I eth1 192.168.105.1
PING 192.168.105.1 (192.168.105.1) from 192.168.105.1 eth1: 56(84) bytes 
of data.
64 bytes from 192.168.105.1: icmp_seq=1 ttl=64 time=0.030 ms
64 bytes from 192.168.105.1: icmp_seq=2 ttl=64 time=0.024 ms
64 bytes from 192.168.105.1: icmp_seq=3 ttl=64 time=0.024 ms

--- 192.168.105.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms

The funny thing is that in both above cases (ping and busybox's ping) i 
verified with wireshark that the ICMP frames where correctly send and 
received (as you said through the lo interface).

> No.     Time        Source                Destination           Protocol Info
>       1 0.000000    192.168.105.1         192.168.105.1         ICMP     Echo (ping) request
>       2 0.000025    192.168.105.1         192.168.105.1         ICMP     Echo (ping) reply
>       3 1.000088    192.168.105.1         192.168.105.1         ICMP     Echo (ping) request
>       4 1.000110    192.168.105.1         192.168.105.1         ICMP     Echo (ping) reply
>       5 2.000171    192.168.105.1         192.168.105.1         ICMP     Echo (ping) request
>       6 2.000194    192.168.105.1         192.168.105.1         ICMP     Echo (ping) reply
>       7 3.000259    192.168.105.1         192.168.105.1         ICMP     Echo (ping) request
>       8 3.000281    192.168.105.1         192.168.105.1         ICMP     Echo (ping) reply
>       9 4.000340    192.168.105.1         192.168.105.1         ICMP     Echo (ping) request
>      10 4.000363    192.168.105.1         192.168.105.1         ICMP     Echo (ping) reply

It is just busybox's ping not representing the replies while "normal" 
ping does.

It's ok for me, i report this just in case it could be a bug.

-- 
Regards,

Javier Viguera
Software Engineer

http://www.digi.com


More information about the busybox mailing list