[PATCH v1 0/2] mac_pton: support more MAC address formats

Michael Pratt posted 2 patches 2 years, 2 months ago
[PATCH v1 0/2] mac_pton: support more MAC address formats
Posted by Michael Pratt 2 years, 2 months ago
Currently, mac_pton() strictly requires the standard ASCII MAC address format
with colons as the delimiter, however,
some hardware vendors don't store the address like that.

If there is no delimiter, one could use strtoul()
but that would leave out important checks to make sure
that each character in the string is hexadecimal.

This series adds support for other delimiters
and lack of any delimiter to the mac_pton() function.

Tested with Openwrt on a MIPS system (ar9344).
Re: [PATCH v1 0/2] mac_pton: support more MAC address formats
Posted by Simon Horman 2 years, 2 months ago
On Mon, Oct 02, 2023 at 11:39:55PM +0000, Michael Pratt wrote:
> Currently, mac_pton() strictly requires the standard ASCII MAC address format
> with colons as the delimiter, however,
> some hardware vendors don't store the address like that.
> 
> If there is no delimiter, one could use strtoul()
> but that would leave out important checks to make sure
> that each character in the string is hexadecimal.
> 
> This series adds support for other delimiters
> and lack of any delimiter to the mac_pton() function.
> 
> Tested with Openwrt on a MIPS system (ar9344).

Hi Michael,

I am wondering if you considered a different approach where,
via parameters and/or new helpers, callers can specify the
delimiter, or absence thereof.