Is there any documentation for dropping zeros in decimal decimal notations of IPV4 addresses?

I noticed that Linux and * BSD systems allow the user to skip octets when using a ten-dot notation.

Here are some examples:

$ ping 10.1 PING 10.1 (10.0.0.1) 56(84) bytes of data. $ ping 10.15.1 PING 10.15.1 (10.15.0.1) 56(84) bytes of data. 

Note that this is not limited to the ping command.

I found a document defining IPV4 textual representations, but does not seem to cover this function: Textual representation of IPv4 and IPv6 addresses .

Is there any other document defining this behavior? Is there a specific name for this behavior?

+6
source share
1 answer

See inet_aton () manpage: http://linux.die.net/man/3/inet_aton The last part is the rest, i.e. 24-bit y in xy and 16-bit z in xyz

+5
source

Source: https://habr.com/ru/post/913095/


All Articles