lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 27 Jun 2013 09:53:46 +0200
From:	Daniel Borkmann <dborkman@...hat.com>
To:	Joe Perches <joe@...ches.com>
CC:	davem@...emloft.net, netdev@...r.kernel.org,
	linux-sctp@...r.kernel.org
Subject: Re: [PATCH net-next 1/2] lib: vsprintf: add IPv4/v6 generic %pig/%pIg
 format specifier

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 !
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ