Re: [PATCH v2 1/2] lib/net_utils: allow mac_pton() to take a custom delimiter

From: Andy Shevchenko

Date: Wed Nov 04 2026 - 04:06:58 EST


On Wed, Nov 04, 2026 at 10:50:57AM +0800, Liu Chao wrote:
> mac_pton() hardcodes ':' as the only accepted separator, which pushes
> callers that need a different notation to open-code their own parser.
>
> Split the body out into parse_mac_pton() taking the set of accepted
> delimiters as a string, and turn mac_pton() into a static inline wrapper
> passing ":" so that every existing caller keeps its current behaviour.
> The strnlen() guard still runs before any delimiter is inspected, so
> strchr() is never handed a NUL character.
>
> No functional change intended.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
Exactly what I had in mind, thanks!

--
With Best Regards,
Andy Shevchenko