All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: James Prestwood <prestwoj@gmail.com>, iwd@lists.linux.dev
Subject: Re: [PATCH 3/3] hwsim: handle ADD/DEL_MAC_ADDR events
Date: Wed, 5 Jul 2023 22:05:13 -0500	[thread overview]
Message-ID: <b4a440d1-7c3f-c677-e4e2-8024f6804a87@gmail.com> (raw)
In-Reply-To: <ecd84c5a-1be2-8d9e-4bad-da4e3c477e7d@gmail.com>

Hi James,

>> +        __atomic_fetch_add(&interface_rec->ref, 1, __ATOMIC_SEQ_CST);
>> +        memcpy(interface_rec->addr, rx, ETH_ALEN);
> 
> Just realized this memcpy is redundant since the interface_rec wouldn't match 
> unless the address was already the same. This case only happens when 
> randomization is off and is a consequence of the kernel having two separate 
> addresses (one prefixed with 0x4, still not sure why they do this). So you get 
> the following events (say the perm address is 02:00:00:00:00:00):
> 
> ADD(tx=42:00:00:00:00:00, rx=02:00:00:00:00:00) (Interface Creation)
> ADD(tx=42:00:00:00:00:00, rx=02:00:00:00:00:00) (Scanning started)
> DEL(tx=42:00:00:00:00:00, rx=02:00:00:00:00:00) (Scanning ended)
> 
> When scan randomization is enabled it will create a completely separate dummy 
> interface and the DEL event can freely delete that.
> 
> I can remove this in v2 if you have additional comments
> 

Ok, I amended the patch to remove the redundant memcpy and applied.  Please 
double check that I didn't screw anything up.

Regards,
-Denis


  reply	other threads:[~2023-07-06  3:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28 20:20 [PATCH 0/3] Handle DEL/ADD_MAC_ADDR events James Prestwood
2023-06-28 20:20 ` [PATCH 1/3] hwsim: add ADD/DEL_MAC_ADDR events James Prestwood
2023-06-28 20:20 ` [PATCH 2/3] hwsim: move frame processing into a separate function James Prestwood
2023-06-28 20:20 ` [PATCH 3/3] hwsim: handle ADD/DEL_MAC_ADDR events James Prestwood
2023-06-28 20:49   ` James Prestwood
2023-07-06  3:05     ` Denis Kenzior [this message]
2023-07-06  3:04 ` [PATCH 0/3] Handle DEL/ADD_MAC_ADDR events Denis Kenzior

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=b4a440d1-7c3f-c677-e4e2-8024f6804a87@gmail.com \
    --to=denkenz@gmail.com \
    --cc=iwd@lists.linux.dev \
    --cc=prestwoj@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.