Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 26 Jun 2018 16:54:35 -0400
From: Rich Felker <dalias@...c.org>
To: Arthur Jones <arthur.jones@...erbed.com>
Cc: musl@...ts.openwall.com, chris@...nsourcerouting.org
Subject: Re: [PATCH] inet_ntop: do not compress single zeros in IPv6

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

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.