Re: [PATCH net-next 1/2] lib: vsprintf: add IPv4/v6 generic %pig/%pIg format specifier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/


--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Networking Development]     [Linux OMAP]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux