From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12949 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] inet_ntop: do not compress single zeros in IPv6 Date: Tue, 26 Jun 2018 16:54:35 -0400 Message-ID: <20180626205435.GB1392@brightrain.aerifal.cx> References: <20180605235127.GA33151@mac_loaner.nbttech.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1530046365 8951 195.159.176.226 (26 Jun 2018 20:52:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 26 Jun 2018 20:52:45 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) Cc: musl@lists.openwall.com, chris@opensourcerouting.org To: Arthur Jones Original-X-From: musl-return-12965-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jun 26 22:52:41 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fXux7-0002Fp-0f for gllmg-musl@m.gmane.org; Tue, 26 Jun 2018 22:52:41 +0200 Original-Received: (qmail 1867 invoked by uid 550); 26 Jun 2018 20:54:49 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 1842 invoked from network); 26 Jun 2018 20:54:49 -0000 Content-Disposition: inline In-Reply-To: <20180605235127.GA33151@mac_loaner.nbttech.com> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:12949 Archived-At: On Tue, Jun 05, 2018 at 04:51:27PM -0700, Arthur Jones wrote: > glibc does not compress a single :0: to ::, we're not > doing anything wrong, but this change will make us more > compatible w/ glibc and fix a downstream testing issue > here: https://github.com/FRRouting/frr/issues/2375 > > I ran the "fix" through libc-test inet_pton.c on alpine > linux edge and it passed... > > I'm not subscribed to the mailing list so please CC me... > --- > src/network/inet_ntop.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/network/inet_ntop.c b/src/network/inet_ntop.c > index 14f9f4c4..4bfef2c5 100644 > --- a/src/network/inet_ntop.c > +++ b/src/network/inet_ntop.c > @@ -36,7 +36,7 @@ const char *inet_ntop(int af, const void *restrict a0, char *restrict s, socklen > j = strspn(buf+i, ":0"); > if (j>max) best=i, max=j; > } > - if (max>2) { > + if (max>3) { > buf[best] = buf[best+1] = ':'; > memmove(buf+best+2, buf+best+max, i-best-max+1); > } > -- > 2.15.1 (Apple Git-101) Thanks. Philip Homburg also included a patch with the initial report of this issue, but I think your patch is simpler/more efficient. Applying. Rich