Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Life, loathe it or ignore it, you can't like it." -- Marvin the paranoid android


devel / comp.unix.programmer / ping and hex/octal in ip-address

SubjectAuthor
* ping and hex/octal in ip-addressRichard Harnden
`* ping and hex/octal in ip-addressScott Lurndal
 `* ping and hex/octal in ip-addressRichard Harnden
  `* ping and hex/octal in ip-addressMuttley
   `* ping and hex/octal in ip-addressLew Pitcher
    `- ping and hex/octal in ip-addressPhilip Guenther

1
ping and hex/octal in ip-address

<uadodt$3o2a$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10805&group=comp.unix.programmer#10805

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: richard....@gmail.com (Richard Harnden)
Newsgroups: comp.unix.programmer
Subject: ping and hex/octal in ip-address
Date: Wed, 2 Aug 2023 15:15:22 +0100
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <uadodt$3o2a$1@dont-email.me>
Reply-To: nospam.harnden@gmail.com
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 2 Aug 2023 14:15:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c185a9633cafc8ad635634338a794cf7";
logging-data="122954"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+CjI3yGy/f9INBnd3JYP8lSWiS19yja8c="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:TdNsck29elqUUtWMAuyk5W/76bM=
 by: Richard Harnden - Wed, 2 Aug 2023 14:15 UTC

Hi,

Is this a bug ... ?

$ ping 0xa.0xb.0xc.0xd
PING 0xa.0xb.0xc.0xd (10.11.12.13) 56(84) bytes of data.
^C
--- 0xa.0xb.0xc.0xd ping statistics ---
8 packets transmitted, 0 received, 100% packet loss, time 7171ms

$ ping 6.7.010.0x9
PING 6.7.010.0x9 (6.7.8.9) 56(84) bytes of data.
^C
--- 6.7.010.0x9 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4108ms

.... non decimal in the dot-quad is new to me, anyway.

Re: ping and hex/octal in ip-address

<m2uyM.83439$ftCb.36439@fx34.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10806&group=comp.unix.programmer#10806

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx34.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: ping and hex/octal in ip-address
Newsgroups: comp.unix.programmer
References: <uadodt$3o2a$1@dont-email.me>
Lines: 25
Message-ID: <m2uyM.83439$ftCb.36439@fx34.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Wed, 02 Aug 2023 14:49:54 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 02 Aug 2023 14:49:54 GMT
X-Received-Bytes: 1365
 by: Scott Lurndal - Wed, 2 Aug 2023 14:49 UTC

Richard Harnden <richard.nospam@gmail.com> writes:
>Hi,
>
>Is this a bug ... ?
>
>$ ping 0xa.0xb.0xc.0xd
>PING 0xa.0xb.0xc.0xd (10.11.12.13) 56(84) bytes of data.
>^C
>--- 0xa.0xb.0xc.0xd ping statistics ---
>8 packets transmitted, 0 received, 100% packet loss, time 7171ms
>
> $ ping 6.7.010.0x9
>PING 6.7.010.0x9 (6.7.8.9) 56(84) bytes of data.
>^C
>--- 6.7.010.0x9 ping statistics ---
>5 packets transmitted, 0 received, 100% packet loss, time 4108ms
>
>... non decimal in the dot-quad is new to me, anyway.

Why would you consider it a bug rather than a feature?

If the ping command uses 'strtoui/strtoul/strtoull' to parse
the argument, it can simply specify '0' as the desired base
and strtoul will detect and accept any supported base (at least
8, 10 and 16).

Re: ping and hex/octal in ip-address

<uadrcl$4ach$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10807&group=comp.unix.programmer#10807

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: richard....@gmail.com (Richard Harnden)
Newsgroups: comp.unix.programmer
Subject: Re: ping and hex/octal in ip-address
Date: Wed, 2 Aug 2023 16:05:56 +0100
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <uadrcl$4ach$1@dont-email.me>
References: <uadodt$3o2a$1@dont-email.me> <m2uyM.83439$ftCb.36439@fx34.iad>
Reply-To: nospam.harnden@gmail.com
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 2 Aug 2023 15:05:57 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c185a9633cafc8ad635634338a794cf7";
logging-data="141713"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19O/nnhYHMaMEN9FGORmTzU5efWjITSKic="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:t4yYszSXtqvUcSivFvS8gxPbLjU=
In-Reply-To: <m2uyM.83439$ftCb.36439@fx34.iad>
 by: Richard Harnden - Wed, 2 Aug 2023 15:05 UTC

On 02/08/2023 15:49, Scott Lurndal wrote:
> Richard Harnden <richard.nospam@gmail.com> writes:
>> Hi,
>>
>> Is this a bug ... ?
>>
>> $ ping 0xa.0xb.0xc.0xd
>> PING 0xa.0xb.0xc.0xd (10.11.12.13) 56(84) bytes of data.
>> ^C
>> --- 0xa.0xb.0xc.0xd ping statistics ---
>> 8 packets transmitted, 0 received, 100% packet loss, time 7171ms
>>
>> $ ping 6.7.010.0x9
>> PING 6.7.010.0x9 (6.7.8.9) 56(84) bytes of data.
>> ^C
>> --- 6.7.010.0x9 ping statistics ---
>> 5 packets transmitted, 0 received, 100% packet loss, time 4108ms
>>
>> ... non decimal in the dot-quad is new to me, anyway.
>
> Why would you consider it a bug rather than a feature?
>
> If the ping command uses 'strtoui/strtoul/strtoull' to parse
> the argument, it can simply specify '0' as the desired base
> and strtoul will detect and accept any supported base (at least
> 8, 10 and 16).

That seems to be exactly what it's doing, yes.

Not exactly a bug - just something I'd never noticed before.

Re: ping and hex/octal in ip-address

<uadtti$50fr$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10808&group=comp.unix.programmer#10808

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Mutt...@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: ping and hex/octal in ip-address
Date: Wed, 2 Aug 2023 15:49:06 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <uadtti$50fr$1@dont-email.me>
References: <uadodt$3o2a$1@dont-email.me> <m2uyM.83439$ftCb.36439@fx34.iad> <uadrcl$4ach$1@dont-email.me>
Injection-Date: Wed, 2 Aug 2023 15:49:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="020dd546ff52c2fd4fff7b8d5af671a5";
logging-data="164347"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/NnaQRffXTSC7/7eL4Vixt"
Cancel-Lock: sha1:a71z09h7VlY4gXuISUdEhYCPgDg=
 by: Mutt...@dastardlyhq.com - Wed, 2 Aug 2023 15:49 UTC

On Wed, 2 Aug 2023 16:05:56 +0100
Richard Harnden <richard.nospam@gmail.com> wrote:
>On 02/08/2023 15:49, Scott Lurndal wrote:
>> Richard Harnden <richard.nospam@gmail.com> writes:
>>> Hi,
>>>
>>> Is this a bug ... ?
>>>
>>> $ ping 0xa.0xb.0xc.0xd
>>> PING 0xa.0xb.0xc.0xd (10.11.12.13) 56(84) bytes of data.
>>> ^C
>>> --- 0xa.0xb.0xc.0xd ping statistics ---
>>> 8 packets transmitted, 0 received, 100% packet loss, time 7171ms
>>>
>>> $ ping 6.7.010.0x9
>>> PING 6.7.010.0x9 (6.7.8.9) 56(84) bytes of data.
>>> ^C
>>> --- 6.7.010.0x9 ping statistics ---
>>> 5 packets transmitted, 0 received, 100% packet loss, time 4108ms
>>>
>>> ... non decimal in the dot-quad is new to me, anyway.
>>
>> Why would you consider it a bug rather than a feature?
>>
>> If the ping command uses 'strtoui/strtoul/strtoull' to parse
>> the argument, it can simply specify '0' as the desired base
>> and strtoul will detect and accept any supported base (at least
>> 8, 10 and 16).
>
>That seems to be exactly what it's doing, yes.
>
>Not exactly a bug - just something I'd never noticed before.

Didn't know it could do that!

Re: ping and hex/octal in ip-address

<uadvpi$4rtg$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10810&group=comp.unix.programmer#10810

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.programmer
Subject: Re: ping and hex/octal in ip-address
Date: Wed, 2 Aug 2023 16:21:06 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Lines: 48
Message-ID: <uadvpi$4rtg$1@dont-email.me>
References: <uadodt$3o2a$1@dont-email.me> <m2uyM.83439$ftCb.36439@fx34.iad>
<uadrcl$4ach$1@dont-email.me> <uadtti$50fr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 2 Aug 2023 16:21:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="27dc3ccae30e494704cdcdc01454403e";
logging-data="159664"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Vs7dofcodqpBreSKUqjQ16LSIc6pVZ3k="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:a4oLLaFw9SSWyLUz5rrp1oGwrng=
 by: Lew Pitcher - Wed, 2 Aug 2023 16:21 UTC

On Wed, 02 Aug 2023 15:49:06 +0000, Muttley wrote:

> On Wed, 2 Aug 2023 16:05:56 +0100
> Richard Harnden <richard.nospam@gmail.com> wrote:
>>On 02/08/2023 15:49, Scott Lurndal wrote:
>>> Richard Harnden <richard.nospam@gmail.com> writes:
>>>> Hi,
>>>>
>>>> Is this a bug ... ?
>>>>
>>>> $ ping 0xa.0xb.0xc.0xd
>>>> PING 0xa.0xb.0xc.0xd (10.11.12.13) 56(84) bytes of data.
>>>> ^C
>>>> --- 0xa.0xb.0xc.0xd ping statistics ---
>>>> 8 packets transmitted, 0 received, 100% packet loss, time 7171ms
>>>>
>>>> $ ping 6.7.010.0x9
>>>> PING 6.7.010.0x9 (6.7.8.9) 56(84) bytes of data.
>>>> ^C
>>>> --- 6.7.010.0x9 ping statistics ---
>>>> 5 packets transmitted, 0 received, 100% packet loss, time 4108ms
>>>>
>>>> ... non decimal in the dot-quad is new to me, anyway.
>>>
>>> Why would you consider it a bug rather than a feature?
>>>
>>> If the ping command uses 'strtoui/strtoul/strtoull' to parse
>>> the argument, it can simply specify '0' as the desired base
>>> and strtoul will detect and accept any supported base (at least
>>> 8, 10 and 16).
>>
>>That seems to be exactly what it's doing, yes.
>>
>>Not exactly a bug - just something I'd never noticed before.
>
> Didn't know it could do that!

You don't even have to stick with dotted-quad format. Witness:

12:19 $ ping 2130706433
PING 2130706433 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.025 ms

:-)

--
Lew Pitcher
"In Skills We Trust"

Re: ping and hex/octal in ip-address

<d5b09cef-df28-4590-a4e5-f741f688ddf0n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10811&group=comp.unix.programmer#10811

  copy link   Newsgroups: comp.unix.programmer
X-Received: by 2002:ac8:5b0e:0:b0:40c:8ba5:33e7 with SMTP id m14-20020ac85b0e000000b0040c8ba533e7mr69891qtw.1.1690997375311;
Wed, 02 Aug 2023 10:29:35 -0700 (PDT)
X-Received: by 2002:a9d:6f91:0:b0:6b9:4b06:709d with SMTP id
h17-20020a9d6f91000000b006b94b06709dmr16618083otq.0.1690997374988; Wed, 02
Aug 2023 10:29:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.programmer
Date: Wed, 2 Aug 2023 10:29:34 -0700 (PDT)
In-Reply-To: <uadvpi$4rtg$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=76.247.182.84; posting-account=bzpegQoAAABnTq5JDqg52UTZOtil5p5c
NNTP-Posting-Host: 76.247.182.84
References: <uadodt$3o2a$1@dont-email.me> <m2uyM.83439$ftCb.36439@fx34.iad>
<uadrcl$4ach$1@dont-email.me> <uadtti$50fr$1@dont-email.me> <uadvpi$4rtg$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d5b09cef-df28-4590-a4e5-f741f688ddf0n@googlegroups.com>
Subject: Re: ping and hex/octal in ip-address
From: guent...@gmail.com (Philip Guenther)
Injection-Date: Wed, 02 Aug 2023 17:29:35 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Philip Guenther - Wed, 2 Aug 2023 17:29 UTC

On Wednesday, August 2, 2023 at 9:21:11 AM UTC-7, Lew Pitcher wrote:
> On Wed, 02 Aug 2023 15:49:06 +0000, Muttley wrote:
>
> > On Wed, 2 Aug 2023 16:05:56 +0100
> > Richard Harnden <richard...@gmail.com> wrote:
> >>On 02/08/2023 15:49, Scott Lurndal wrote:
> >>> Richard Harnden <richard...@gmail.com> writes:
> >>>> Hi,
> >>>>
> >>>> Is this a bug ... ?
> >>>>
> >>>> $ ping 0xa.0xb.0xc.0xd
> >>>> PING 0xa.0xb.0xc.0xd (10.11.12.13) 56(84) bytes of data.
> >>>> ^C
> >>>> --- 0xa.0xb.0xc.0xd ping statistics ---
> >>>> 8 packets transmitted, 0 received, 100% packet loss, time 7171ms
> >>>>
> >>>> $ ping 6.7.010.0x9
> >>>> PING 6.7.010.0x9 (6.7.8.9) 56(84) bytes of data.
> >>>> ^C
> >>>> --- 6.7.010.0x9 ping statistics ---
> >>>> 5 packets transmitted, 0 received, 100% packet loss, time 4108ms
> >>>>
> >>>> ... non decimal in the dot-quad is new to me, anyway.
> >>>
> >>> Why would you consider it a bug rather than a feature?
> >>>
> >>> If the ping command uses 'strtoui/strtoul/strtoull' to parse
> >>> the argument, it can simply specify '0' as the desired base
> >>> and strtoul will detect and accept any supported base (at least
> >>> 8, 10 and 16).
> >>
> >>That seems to be exactly what it's doing, yes.
> >>
> >>Not exactly a bug - just something I'd never noticed before.
> >
> > Didn't know it could do that!
> You don't even have to stick with dotted-quad format. Witness:
>
> 12:19 $ ping 2130706433
> PING 2130706433 (127.0.0.1) 56(84) bytes of data.
> 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.025 ms
>
> :-)

Right: the inet_aton(3) and inet_addr(3) routines for converting textual IPv4 addresses into the 'machine' format did that from the start and the behavior actually ended up being specified in the X/Open XNS and POSIX standards for them.

On the other hand, the newer inet_pton(3) routine which supports both IPv4 and IPv6 is specified to *not* support those formats so whether this wart works for a given program depends on how it was implemented. Indeed, some implementations of ping have switched over to use inet_pton(). <shrug>

Philip Guenther

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor