Closed coot closed 4 months ago
Merged and a new version has been released. Thanks!
Thanks @kazu-yamamoto.
When I talked with my team, some people suggested not parsing white space, but this could have wild consequences for downstream users - hence, I preserved it. However, I checked that inet_pton
on Linux, doesn't parse white space on either side.
Hmm, I just realized that by admitting trailing white space, we allow this to parse 0.0.0.0 /32
, which is also wrong.
> read "0.0.0.0 /32" :: IPRange
0.0.0.0/32
I'll create a PR to fix this.
Sadly, this PR also broke parsing of IPv6 ranges with embedded IPv4 addresses. The range "::ffff:0.0.0.0/96"
no longer parses, because the termination check in parsing embedded addresses objects to the "/96".
The existing parser admits
0.0.0.0.
to be parsed as a validIPv4
address, while it isn't.