Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jul 2026 14:09:17 +0200
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@FreeBSD.org>
To:        "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
Cc:        src-committers@FreeBSD.org,  dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: git: fbe0257b5613 - main - libc/resolv: Reimplement the sortlist parser
Message-ID:  <86mrvnyydu.fsf@ltc.des.dev>
In-Reply-To: <8633xv5lxw.fsf@ltc.des.dev> ("Dag-Erling =?utf-8?Q?Sm=C3=B8r?= =?utf-8?Q?grav=22's?= message of "Tue, 07 Jul 2026 08:54:35 %2B0200")
References:  <6a4b9e7c.3a45f.1bda28f6@gitrepo.freebsd.org> <40s77q5o-q2no-p79r-7719-67np83p1934s@mnoonqbm.arg> <8633xv5lxw.fsf@ltc.des.dev>

index | next in thread | previous in thread | raw e-mail

Dag-Erling Smørgrav <des@FreeBSD.org> writes:
> "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net> 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 - des@FreeBSD.org


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86mrvnyydu.fsf>