From: Joe Perches <joe@perches.com>
To: Daniel Borkmann <dborkman@redhat.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-sctp@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] lib: vsprintf: add IPv4/v6 generic %pig/%pIg format specifier
Date: Wed, 26 Jun 2013 18:05:04 -0700 [thread overview]
Message-ID: <1372295104.2172.26.camel@joe-AO722> (raw)
In-Reply-To: <1372266073-11998-2-git-send-email-dborkman@redhat.com>
On Wed, 2013-06-26 at 19:01 +0200, Daniel Borkmann wrote:
> In order to avoid making code that deals with printing both, IPv4 and
> IPv6 addresses, unnecessary complicated as for example ...
>
> if (sa.sa_family == AF_INET6)
> printk("... %pI6 ...", sin6_addr);
> else
> printk("... %pI4 ...", sin_addr.s_addr);
[]
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
[]
> @@ -1093,6 +1093,18 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
[]
> + case 'g':
> + {
This is overly indented.
Just use:
case 'g': {
etc...
(%pig looks poorly named though)
I'd prefer "%piS" for "struct sockaddr"
Some other options might be to add port, flowinfo or scope,
See: http://patchwork.ozlabs.org/patch/31480/
next prev parent reply other threads:[~2013-06-27 1:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-26 17:01 [PATCH net-next 0/2] Rework SCTP debugging framework Daniel Borkmann
2013-06-26 17:01 ` [PATCH net-next 1/2] lib: vsprintf: add IPv4/v6 generic %pig/%pIg format specifier Daniel Borkmann
2013-06-26 17:27 ` Vlad Yasevich
2013-06-26 18:35 ` Daniel Borkmann
2013-06-27 11:00 ` Neil Horman
2013-06-27 1:05 ` Joe Perches [this message]
2013-06-27 7:53 ` Daniel Borkmann
2013-06-27 1:37 ` Cong Wang
2013-06-27 7:47 ` Daniel Borkmann
2013-06-26 17:01 ` [PATCH net-next 2/2] net: sctp: rework debugging framework to use pr_debug and friends Daniel Borkmann
2013-06-27 2:32 ` Vlad Yasevich
2013-06-26 20:26 ` [PATCH net-next 0/2] Rework SCTP debugging framework David Miller
2013-06-26 20:53 ` Daniel Borkmann
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=1372295104.2172.26.camel@joe-AO722 \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=dborkman@redhat.com \
--cc=linux-sctp@vger.kernel.org \
--cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).