Subject: Re: [PATCH net-next] net: add check for current MAC address in dev_set_mac_address

From: Jakub Kicinski <[email-masked]>
Date: Mon, 12 Jun 2023 10:39:01 -0700

On Mon, 12 Jun 2023 18:43:01 +0200 Piotr Gardocki wrote:
> On 12.06.2023 17:37, Maciej Fijalkowski wrote:
> > On Mon, Jun 12, 2023 at 04:49:47PM +0200, Piotr Gardocki wrote:  
> >> 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.

I'm probably missing something because I'm not sure where 
the discussion about AF_LOCAL came from. All I meant is:

	if (!memcmp(dev->dev_addr, sa->sa_data, dev->addr_len))
		return 0;