netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: atlantic: fix check for invalid ethernet addresses
@ 2022-11-30 17:42 Brian Masney
  2022-11-30 17:57 ` Brian Masney
  2022-11-30 19:41 ` Andrew Lunn
  0 siblings, 2 replies; 13+ messages in thread
From: Brian Masney @ 2022-11-30 17:42 UTC (permalink / raw)
  To: irusskikh, davem, edumazet, kuba, pabeni; +Cc: netdev, linux-kernel, cth451

The Qualcomm sa8540p automotive development board (QDrive3) has an
Aquantia NIC wired over PCIe. The ethernet MAC address assigned to
all of the boards in our lab is 00:17:b6:00:00:00. The existing
check in aq_nic_is_valid_ether_addr() only checks for leading zeros
in the MAC address. Let's update the check to also check for trailing
zeros in the MAC address so that a random MAC address is assigned
in this case.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
index 06508eebb585..c9c850bbc805 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
@@ -293,7 +293,8 @@ static bool aq_nic_is_valid_ether_addr(const u8 *addr)
 	/* Some engineering samples of Aquantia NICs are provisioned with a
 	 * partially populated MAC, which is still invalid.
 	 */
-	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);
 }
 
 int aq_nic_ndev_register(struct aq_nic_s *self)
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-12-01 15:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-30 17:42 [PATCH] net: atlantic: fix check for invalid ethernet addresses Brian Masney
2022-11-30 17:57 ` Brian Masney
2022-11-30 18:26   ` Tianhao Chai
2022-11-30 18:47     ` Brian Masney
2022-11-30 19:41 ` Andrew Lunn
2022-11-30 21:08   ` Brian Masney
2022-11-30 21:32     ` Andrew Lunn
2022-11-30 23:12       ` David Laight
2022-12-01  2:22         ` Andrew Lunn
2022-12-01  8:07       ` [EXT] " Igor Russkikh
2022-12-01 13:55         ` Brian Masney
2022-12-01 14:14         ` Andrew Lunn
2022-12-01 15:18           ` Igor Russkikh

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).