Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1287744

Re: [PATCHv2 1/2] Print: Add print format for 8-byte EUI-64 type

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCHv2 1/2] Print: Add print format for 8-byte EUI-64 type
Date 2015-12-09 20:10 +0100
Message-ID <qDShH-3Zb-1@gated-at.bofh.it> (permalink)
References <qDRYl-3AU-3@gated-at.bofh.it> <qDRYl-3AU-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 2015-12-09 at 11:42 -0700, Keith Busch wrote:
> MAC addresses may be formed using rules based on EUI-64, which is 2 bytes
> longer than a typical 6-byte MAC. This patch adds a long specifier to
> the %pM format to support the extended unique identifier.
[]
> diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt
[]
> @@ -136,14 +136,21 @@ Raw buffer as a hex string:
>  MAC/FDDI addresses:
>  
>  	%pM	00:01:02:03:04:05
> +	%pMl	00:01:02:03:04:05:06:07
>  	%pMR	05:04:03:02:01:00
> +	%pMRl	07:06:05:04:03:02:01:00
>  	%pMF	00-01-02-03-04-05
> +	%pMFl	00-01-02-03-04-05-06-07
>  	%pm	000102030405
> +	%pml	0001020304050607
>  	%pmR	050403020100
> +	%pmRl	0706050403020100
[]
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
[]
> @@ -908,14 +908,21 @@ char *mac_address_string(char *buf, char *end, u8 *addr,
>  		separator = ':';
>  		break;
>  	}
> +	switch (fmt[2]) {
> +	case 'l':
> +		bytes = 8;
> +		break;
> +	default:
> +		break;
> +	}

This doesn't work for formats without pmR or pmF.
like "%pml" or "%pMl" as fmt[2] can be anything.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv2 0/2] NVMe namespace identification Keith Busch <keith.busch@intel.com> - 2015-12-09 19:50 +0100
  [PATCHv2 1/2] Print: Add print format for 8-byte EUI-64 type Keith Busch <keith.busch@intel.com> - 2015-12-09 19:50 +0100
    Re: [PATCHv2 1/2] Print: Add print format for 8-byte EUI-64 type Joe Perches <joe@perches.com> - 2015-12-09 20:10 +0100
  [PATCHv2 2/2] NVMe: Expose namespace identity attribute to sysfs Keith Busch <keith.busch@intel.com> - 2015-12-09 19:50 +0100

csiph-web