From: Daniel Borkmann <dborkman@redhat.com>
To: Vlad Yasevich <vyasevich@gmail.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:35:13 +0000 [thread overview]
Message-ID: <51CB3461.9020703@redhat.com> (raw)
In-Reply-To: <51CB2477.6070903@gmail.com>
On 06/26/2013 07:27 PM, Vlad Yasevich wrote:
> On 06/26/2013 01:01 PM, 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);
>>
>> ... it would be better to introduce a format specifier that can deal
>> with those kind of situations internally; just as we have a "struct
>> sockaddr" for generic mapping into "struct sockaddr_in" or "struct
>> sockaddr_in6" as e.g. done in "union sctp_addr". Then, we could
>> reduce the above statement into something like:
>>
>> printk("... %pIg ..", &sockaddr);
>>
>> While we're at it, support for both %pig/%pIg, where 'g' stands for
>> generic, comes for free. In case our pointer is NULL, pointer() then
>> deals with that already at an earlier point in time internally.
>>
>> Likely, there are many other areas than just SCTP in the kernel to make
>> use of this extension as well.
>>
>> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
>> ---
>> lib/vsprintf.c | 18 ++++++++++++++++--
>> 1 file changed, 16 insertions(+), 2 deletions(-)
>
> I think you should also update Documentation/printk-formats.txt
If you prefer, I could do a follow-up patch, otherwise I'd send a v2 of
the set by tomorrow if there's nothing else, let me know.
Thanks,
Daniel
WARNING: multiple messages have this Message-ID (diff)
From: Daniel Borkmann <dborkman@redhat.com>
To: Vlad Yasevich <vyasevich@gmail.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 20:35:13 +0200 [thread overview]
Message-ID: <51CB3461.9020703@redhat.com> (raw)
In-Reply-To: <51CB2477.6070903@gmail.com>
On 06/26/2013 07:27 PM, Vlad Yasevich wrote:
> On 06/26/2013 01:01 PM, 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);
>>
>> ... it would be better to introduce a format specifier that can deal
>> with those kind of situations internally; just as we have a "struct
>> sockaddr" for generic mapping into "struct sockaddr_in" or "struct
>> sockaddr_in6" as e.g. done in "union sctp_addr". Then, we could
>> reduce the above statement into something like:
>>
>> printk("... %pIg ..", &sockaddr);
>>
>> While we're at it, support for both %pig/%pIg, where 'g' stands for
>> generic, comes for free. In case our pointer is NULL, pointer() then
>> deals with that already at an earlier point in time internally.
>>
>> Likely, there are many other areas than just SCTP in the kernel to make
>> use of this extension as well.
>>
>> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
>> ---
>> lib/vsprintf.c | 18 ++++++++++++++++--
>> 1 file changed, 16 insertions(+), 2 deletions(-)
>
> I think you should also update Documentation/printk-formats.txt
If you prefer, I could do a follow-up patch, otherwise I'd send a v2 of
the set by tomorrow if there's nothing else, let me know.
Thanks,
Daniel
next prev parent reply other threads:[~2013-06-26 18:35 UTC|newest]
Thread overview: 24+ 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 ` 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:01 ` Daniel Borkmann
2013-06-26 17:27 ` Vlad Yasevich
2013-06-26 17:27 ` Vlad Yasevich
2013-06-26 18:35 ` Daniel Borkmann [this message]
2013-06-26 18:35 ` Daniel Borkmann
2013-06-27 11:00 ` Neil Horman
2013-06-27 11:00 ` Neil Horman
2013-06-27 1:05 ` Joe Perches
2013-06-27 1:05 ` Joe Perches
2013-06-27 7:53 ` Daniel Borkmann
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-26 17:01 ` Daniel Borkmann
2013-06-27 2:32 ` Vlad Yasevich
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:26 ` David Miller
2013-06-26 20:53 ` Daniel Borkmann
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=51CB3461.9020703@redhat.com \
--to=dborkman@redhat.com \
--cc=davem@davemloft.net \
--cc=linux-sctp@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vyasevich@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.