[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: ipcalc is peculiar



Putting a '0' in front of a number is a way of forcing it to be interpreted as octal. 017 is a valid octal number, corresponding to the decimal value 15. However, 019 is not a valid number since you can't have '9' in an octal number.

/dh

John wrote:

As I understand it, the four segments of a human'comprehendable IP address are decimal number. Not binary, not hexadecimal or octal, decimal.
[spam debian spam]$ ipcalc --network 172.19.0.1/8
NETWORK=172.0.0.0
[spam debian spam]$ ipcalc --network 172.019.0.1/8
ipcalc: bad ip address: 172.019.0.1
[spam debian spam]$ ipcalc --network 172.17.0.1/8
NETWORK=172.0.0.0
[spam debian spam]$ ipcalc --network 172.017.0.1/8
NETWORK=172.0.0.0
[spam debian spam]$



I believe, but haven't tested recently, that ifconfig also has this affliction.











[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]