[PATCH] net/virtio: fix MAC table update

skoteshwar at marvell.com skoteshwar at marvell.com
Thu May 30 19:40:39 CEST 2024


From: Satha Rao <skoteshwar at marvell.com>

Don't send NULL MAC addresses in MAC table update.

Fixes: 1b306359e58 ("virtio: suport multiple MAC addresses")
Cc: stephen at networkplumber.org
Cc: stable at dpdk.org

Signed-off-by: Satha Rao <skoteshwar at marvell.com>
---
 drivers/net/virtio/virtio_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 5175857..70d4839 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -913,6 +913,8 @@ static int virtio_dev_xstats_get_names(struct rte_eth_dev *dev,
 		struct virtio_net_ctrl_mac *tbl
 			= rte_is_multicast_ether_addr(addr) ? mc : uc;
 
+		if (rte_is_zero_ether_addr(addr))
+			break;
 		memcpy(&tbl->macs[tbl->entries++], addr, RTE_ETHER_ADDR_LEN);
 	}
 
-- 
1.8.3.1



More information about the dev mailing list