Re: [PATCH] net: atlantic: fix check for invalid ethernet addresses

From: Andrew Lunn
Date: Wed Nov 30 2022 - 16:33:36 EST


> > > - return !(addr[0] == 0 && addr[1] == 0 && addr[2] == 0);
> > > + return !(addr[0] == 0 && addr[1] == 0 && addr[2] == 0) &&
> > > + !(addr[3] == 0 && addr[4] == 0 && addr[5] == 0);
> >
> > Hi Brian
> >
> > is_valid_ether_addr()
>
> aq_nic_ndev_register() already calls is_valid_ether_addr():
>
> if (is_valid_ether_addr(addr) &&
> aq_nic_is_valid_ether_addr(addr)) {
> (self->ndev, addr);
> } else {
> ...
> }
>
> That won't work for this board since that function only checks that the
> MAC "is not 00:00:00:00:00:00, is not a multicast address, and is not
> FF:FF:FF:FF:FF:FF." The MAC address that we get on all of our boards is
> 00:17:b6:00:00:00.

Which is a valid MAC address. So i don't see why the kernel should
reject it and use a random one.

Maybe you should talk to Marvell about how you can program the
e-fuses. You can then use MAC addresses from A8-97-DC etc.

Andrew