From: Daniel Borkmann <dborkman@redhat.com>
To: Joe Perches <joe@perches.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: Thu, 27 Jun 2013 09:53:46 +0200 [thread overview]
Message-ID: <51CBEF8A.2000407@redhat.com> (raw)
In-Reply-To: <1372295104.2172.26.camel@joe-AO722>
On 06/27/2013 03:05 AM, Joe Perches wrote:
> 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"
Ok, sure, I've changed the above two already. Thanks Joe !
> Some other options might be to add port, flowinfo or scope,
>
> See: http://patchwork.ozlabs.org/patch/31480/
Right, if there's a real need somewhere (I'm sure there is), then this could
be done as a follow-up improvement.
As this is currently not related to the SCTP set that I intended this for, I
wanted to keep this minimal.
Thanks !
next prev parent reply other threads:[~2013-06-27 7:53 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
2013-06-27 7:53 ` Daniel Borkmann [this message]
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=51CBEF8A.2000407@redhat.com \
--to=dborkman@redhat.com \
--cc=davem@davemloft.net \
--cc=joe@perches.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).