Dag-Erling Smørgrav <[email protected]> writes:
> "Bjoern A. Zeeb" <[email protected]> writes:
> > one could likely make the blocks above and below even simpler if one used
> > inet_cidr_pton(), which will also deal with the mask, so one does not have
> > to parse it away and checking it onself per-AF.
> inet_cidr_pton() is undocumented, so it might as well not exist.

In addition to being undocumented and having a gratuitously different
return value scheme than inet_pton(), inet_cidr_pton() is incapable of
correctly parsing trivial cases such as:

* ::/0 incorrectly parsed as ::/-1
    
* 0.0.0.0/0 incorrectly parsed as either ::/128 or 0.0.0.0/32 depending
  on which AF you try

* 2001:db8::/32 incorrectly parsed as 2001:db8::/-1

DES
-- 
Dag-Erling Smørgrav - [email protected]

Reply via email to