From: David Miller <davem@davemloft.net>
To: adobriyan@gmail.com
Cc: netdev@vger.kernel.org, shemminger@vyatta.com
Subject: Re: [PATCH v2] net: add mac_pton() for parsing MAC address
Date: Mon, 09 May 2011 12:11:07 -0700 (PDT) [thread overview]
Message-ID: <20110509.121107.179924768.davem@davemloft.net> (raw)
In-Reply-To: <20110508090007.GA5094@p183>
From: Alexey Dobriyan <adobriyan@gmail.com>
Date: Sun, 8 May 2011 12:00:07 +0300
> mac_pton() parses MAC address in form XX:XX:XX:XX:XX:XX and only in that form.
>
> mac_pton() doesn't dirty result until it's sure string representation is valid.
>
> mac_pton() doesn't care about characters _after_ last octet,
> it's up to caller to deal with it.
>
> mac_pton() diverges from 0/-E return value convention.
> Target usage:
>
> if (!mac_pton(str, whatever->mac))
> return -EINVAL;
> /* ->mac being u8 [ETH_ALEN] is filled at this point. */
> /* optionally check str[3 * ETH_ALEN - 1] for termination */
>
> Use mac_pton() in pktgen and netconsole for start.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Applied.
prev parent reply other threads:[~2011-05-09 19:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-08 9:00 [PATCH v2] net: add mac_pton() for parsing MAC address Alexey Dobriyan
2011-05-09 19:11 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110509.121107.179924768.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=adobriyan@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).