Search code examples
network-programmingipipv4

Weird IPv4 Representation with Leading zero(s)?


Writing a small validator and parser of string representations of IPv4, I wonder if there are IP-Representations like 127.000.000.001 out there? I know this is strange but appears to be legal IP-Representations after all.


Solution

  • Yes. It can happen here's an example.

    Problem is, leading zeroes in an IP can sometimes mean that the IP is written in octal.