[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZIc7y9PdEdyCBb9r@boxer>
Date: Mon, 12 Jun 2023 17:37:47 +0200
From: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
To: Piotr Gardocki <piotrx.gardocki@...el.com>
CC: Jakub Kicinski <kuba@...nel.org>, <netdev@...r.kernel.org>,
<przemyslaw.kitszel@...el.com>, <michal.swiatkowski@...ux.intel.com>,
<pmenzel@...gen.mpg.de>, <anthony.l.nguyen@...el.com>,
<simon.horman@...igine.com>, <aleksander.lobakin@...el.com>
Subject: Re: [PATCH net-next] net: add check for current MAC address in
dev_set_mac_address
On Mon, Jun 12, 2023 at 04:49:47PM +0200, Piotr Gardocki wrote:
> On 10.06.2023 08:44, Jakub Kicinski wrote:
> > On Fri, 9 Jun 2023 18:52:41 +0200 Piotr Gardocki wrote:
> >> + if (ether_addr_equal(dev->dev_addr, sa->sa_data))
> >> + return 0;
> >
> > not every device is ethernet, you need to use dev->addr_len for
> > the comparison.
>
> Before re-sending I just want to double check.
> Did you mean checking if sa->sa_family == AF_LOCAL ?
> There's no length in sockaddr.
>
> It would like this:
> if (sa->sa_family == AF_LOCAL &&
> ether_addr_equal(dev->dev_addr, sa->sa_data))
> return 0;
I believe Jakub just wanted this:
if (dev->addr_len)
if (ether_addr_equal(dev->dev_addr, sa->sa_data))
return 0;
so no clue why you want anything from sockaddr?
Powered by blists - more mailing lists