public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Andrew Murray <amurray@mpcdata.com>
Subject: [PATCH] vsprintf: Update %pI6c to not compress a single 0
Date: Thu, 09 Jun 2011 11:23:37 -0700	[thread overview]
Message-ID: <1307643817.13329.32.camel@Joe-Laptop> (raw)
In-Reply-To: <1307642692-23556-1-git-send-email-amurray@mpcdata.com>

RFC 5952 http://tools.ietf.org/html/rfc5952
mandates that 2 or more consecutive 0's are
required before using :: compression.

Update ip6_compressed_string to match the RFC and
update the http reference as well.

Signed-off-by: Joe Perches <joe@perches.com>
---
 lib/vsprintf.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index c112056..4365df3 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -666,6 +666,8 @@ char *ip6_compressed_string(char *p, const char *addr)
 			colonpos = i;
 		}
 	}
+	if (longest == 1)		/* don't compress a single 0 */
+		colonpos = -1;
 
 	/* emit address */
 	for (i = 0; i < range; i++) {
@@ -826,7 +828,7 @@ int kptr_restrict __read_mostly;
  *       IPv4 uses dot-separated decimal with leading 0's (010.123.045.006)
  * - '[Ii]4[hnbl]' IPv4 addresses in host, network, big or little endian order
  * - 'I6c' for IPv6 addresses printed as specified by
- *       http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-00
+ *       http://tools.ietf.org/html/rfc5952
  * - 'U' For a 16 byte UUID/GUID, it prints the UUID/GUID in the form
  *       "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  *       Options for %pU are:
-- 
1.7.6.rc0




  parent reply	other threads:[~2011-06-09 18:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-06  0:15 [PATCH] printk-formats.txt documentation update Andrew Murray
2011-02-06  0:27 ` Tim Bird
2011-02-06  0:37 ` Joe Perches
2011-02-06 10:07   ` Andrew Murray
2011-02-06 10:16 ` Geert Uytterhoeven
2011-02-06 16:14   ` Andrew Murray
2011-02-06 16:23     ` Andrew Murray
2011-02-07  9:29       ` Wolfram Sang
2011-02-07 18:12         ` Andrew Murray
2011-02-07 19:33           ` Joe Perches
2011-02-11  8:15             ` Andrew Murray
2011-06-09 17:33               ` [PATCH] Revised patch Andrew Murray
2011-06-09 17:40                 ` Joe Perches
2011-06-09 17:47                   ` Namhyung Kim
2011-06-09 17:48                     ` Andrew Murray
2011-06-09 18:04                       ` [PATCH] printk-formats.txt documentation update Andrew Murray
2011-06-09 18:20                         ` Namhyung Kim
2011-06-09 18:55                           ` Andrew Murray
2011-06-09 19:45                             ` Randy Dunlap
2011-06-09 21:24                               ` Andrew Murray
2011-06-09 21:51                                 ` Randy Dunlap
2011-06-09 22:00                                   ` Joe Perches
2011-06-09 22:21                                     ` Andrew Murray
2011-06-09 22:37                                     ` Randy Dunlap
2011-06-09 22:53                                       ` Joe Perches
2011-06-09 22:57                                         ` Randy Dunlap
2011-06-10 17:50                                 ` Randy Dunlap
2011-06-10 17:56                                   ` Andrew Murray
2011-06-09 18:23                         ` Joe Perches [this message]
2011-06-09 17:47                 ` [PATCH] Revised patch Randy Dunlap
2011-06-09 17:53                   ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1307643817.13329.32.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=amurray@mpcdata.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox