From: Piotr Gardocki <piotrx.gardocki@intel.com>
To: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Cc: Jakub Kicinski <kuba@kernel.org>, <netdev@vger.kernel.org>,
<przemyslaw.kitszel@intel.com>,
<michal.swiatkowski@linux.intel.com>, <pmenzel@molgen.mpg.de>,
<anthony.l.nguyen@intel.com>, <simon.horman@corigine.com>,
<aleksander.lobakin@intel.com>
Subject: Re: [PATCH net-next] net: add check for current MAC address in dev_set_mac_address
Date: Mon, 12 Jun 2023 18:43:01 +0200 [thread overview]
Message-ID: <f77b5c89-0f3d-80f9-19f4-f82a2ebf524e@intel.com> (raw)
In-Reply-To: <ZIc7y9PdEdyCBb9r@boxer>
On 12.06.2023 17:37, Maciej Fijalkowski wrote:
> 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?
I understood that dev->type and dev->addr_len can just be different
than AF_LOCAL and 48 bits in this function.
Your version does not convince me, let's wait for Jakub's judgement.
next prev parent reply other threads:[~2023-06-12 16:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-09 16:52 [PATCH net-next] net: add check for current MAC address in dev_set_mac_address Piotr Gardocki
2023-06-09 17:00 ` Maciej Fijalkowski
2023-06-09 17:11 ` Piotr Gardocki
2023-06-10 6:44 ` Jakub Kicinski
2023-06-12 14:49 ` Piotr Gardocki
2023-06-12 15:37 ` Maciej Fijalkowski
2023-06-12 16:43 ` Piotr Gardocki [this message]
2023-06-12 17:39 ` Jakub Kicinski
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=f77b5c89-0f3d-80f9-19f4-f82a2ebf524e@intel.com \
--to=piotrx.gardocki@intel.com \
--cc=aleksander.lobakin@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=kuba@kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=michal.swiatkowski@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pmenzel@molgen.mpg.de \
--cc=przemyslaw.kitszel@intel.com \
--cc=simon.horman@corigine.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).