From owner-freebsd-net@FreeBSD.ORG Sun May 16 19:21:49 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAD2D1065672 for ; Sun, 16 May 2010 19:21:49 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id 957A68FC1B for ; Sun, 16 May 2010 19:21:49 +0000 (UTC) Received: (qmail 30610 invoked by uid 399); 16 May 2010 19:21:47 -0000 Received: from localhost (HELO ?192.168.0.145?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 16 May 2010 19:21:47 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4BF045C9.1040906@FreeBSD.org> Date: Sun, 16 May 2010 12:21:45 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Alfred Perlstein References: <20100516062211.GC6175@elvis.mu.org> In-Reply-To: <20100516062211.GC6175@elvis.mu.org> X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: Patch for ip6_sprintf(), please review X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 May 2010 19:21:50 -0000 Someone at work has been reading http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation :) This change follows the rules in that draft which will become and RFC as soon as it finishes winding its way through the process, so I am supportive of the change you are proposing. Doug On 5/15/2010 11:22 PM, Alfred Perlstein wrote: > Hello, > > The following patch seems appropriate to apply > to fix the kernel ip6_sprintf() function. > > What it is doing is ensuring that when we > abbreviate addresses that the longest string > of zeros is shortend, not the first run of > zeros. > > Our internal commit log is: > problem: > Unification of IPv6 address representation > fix: > recommended format of text representing an IPv6 address > is summarized as follows. > > 1. omit leading zeros > > 2. "::" used to their maximum extent whenever possible > > 3. "::" used where shortens address the most > > 4. "::" used in the former part in case of a tie breaker > > 5. do not shorten one 16 bit 0 field > > 6. use lower case > > Present code in ip6_sprintf() is following rules 1,2,5,6. > Adding fix for following other rules also.For following > rules 3 and 4, finding out the index where to replace zero's > with '::' and using that index. > References: > http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04.html > > > Diff is attached in text format. > > > > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/