tisdag den  7 december 2010 klockan 13:22 skrev Simon Josefsson detta:
> Mats Erik Andersson <[email protected]> writes:
> 
> > Hello again,
> >
> > there is an old bug report [1] filed with Debian, which makes much sense.
> > It is a wish that the call
> >
> >     ping 10
> >
> > should return an error, since no host can consist of a single octet,
> > and neither is an IPv4 address with initial octet 0 possible.
> 
> Isn't this traditional behaviour of BSD ping?

Do you mean to say that "ping 10" being equivalent to
"actively and stubbornly have a go at 'ping 0.0.0.10'",
that this is the traditional behaviour?

This is what OpenBSD 4.6 and FreeBSD 8.0 do this very day,
which still is a daft way to act. This is also the behaviour
of present day Inetutils.

The default package "iputils-ping" aborts and truthfully states
that "10" is an invalid argument.

The differing behaviour boils down to believing the output
of inet_aton(3), or not to do so. This old library call
transforms

    10       -->  0.0.0.10

    10.1     --> 10.0.0.1

    10.2.1   --> 10.0.2.1

    10.3.2.1 --> 10.3.2.1

(Filling at right, except first octet, in multi-octet argument!)

In comparison "ping6 10" aborts also in BSD with an error.
Therefore, it would be consistent and sensible to implement
this also for IPv4 pinging.


Regards,

Mats

Reply via email to