From: Sascha Hauer <s.hauer@pengutronix.de>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] net: only use ethaddrs registered with device node on that device
Date: Thu, 8 Nov 2018 08:54:17 +0100 [thread overview]
Message-ID: <20181108075417.y2x3sijgyymvoiph@pengutronix.de> (raw)
In-Reply-To: <20181107202215.2312-1-l.stach@pengutronix.de>
On Wed, Nov 07, 2018 at 09:22:15PM +0100, Lucas Stach wrote:
> If an ethaddr is registered with a device node the ethid is set
> to 0 via the struct initialization. Now if a device without a node
> (for eaxample a USB network adapter) with ethid 0 looks up the
> ethaddr it will wrongly get that address assigned, as the ethid
> matches.
>
> Avoid this by setting the ethid to something that no device will
> ever use when the addr is registered via a device node.
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
> net/eth.c | 1 +
> 1 file changed, 1 insertion(+)
Applied, thanks
Sascha
>
> diff --git a/net/eth.c b/net/eth.c
> index 9dc44119528e..badd18343349 100644
> --- a/net/eth.c
> +++ b/net/eth.c
> @@ -150,6 +150,7 @@ void of_eth_register_ethaddr(struct device_node *node, const char *ethaddr)
>
> addr = xzalloc(sizeof(*addr));
> addr->node = node;
> + addr->ethid = -1;
> memcpy(addr->ethaddr, ethaddr, ETH_ALEN);
> list_add_tail(&addr->list, ðaddr_list);
> }
> --
> 2.19.1
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2018-11-08 7:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-07 20:22 Lucas Stach
2018-11-08 7:54 ` Sascha Hauer [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=20181108075417.y2x3sijgyymvoiph@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=l.stach@pengutronix.de \
/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