svn commit: r353844 - head/sys/dev/e1000

Gleb Smirnoff glebius at FreeBSD.org
Mon Oct 21 18:11:28 UTC 2019


Author: glebius
Date: Mon Oct 21 18:11:24 2019
New Revision: 353844
URL: https://svnweb.freebsd.org/changeset/base/353844

Log:
  Convert to if_foreach_llmaddr() KPI.

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==============================================================================
--- head/sys/dev/e1000/if_em.c	Mon Oct 21 18:11:19 2019	(r353843)
+++ head/sys/dev/e1000/if_em.c	Mon Oct 21 18:11:24 2019	(r353844)
@@ -1655,7 +1655,7 @@ em_disable_promisc(if_ctx_t ctx)
 	if (if_getflags(ifp) & IFF_ALLMULTI)
 		mcnt = MAX_NUM_MULTICAST_ADDRESSES;
 	else
-		mcnt = if_multiaddr_count(ifp, MAX_NUM_MULTICAST_ADDRESSES);
+		mcnt = if_llmaddr_count(ifp);
 	/* Don't disable if in MAX groups */
 	if (mcnt < MAX_NUM_MULTICAST_ADDRESSES)
 		reg_rctl &=  (~E1000_RCTL_MPE);
@@ -1664,6 +1664,19 @@ em_disable_promisc(if_ctx_t ctx)
 }
 
 
+static u_int
+em_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt)
+{
+	u8 *mta = arg;
+
+	if (cnt == MAX_NUM_MULTICAST_ADDRESSES)
+		return (1);
+
+	bcopy(LLADDR(sdl), &mta[cnt * ETH_ADDR_LEN], ETH_ADDR_LEN);
+
+	return (1);
+}
+
 /*********************************************************************
  *  Multicast Update
  *
@@ -1695,7 +1708,7 @@ em_if_multi_set(if_ctx_t ctx)
 		msec_delay(5);
 	}
 
-	if_multiaddr_array(ifp, mta, &mcnt, MAX_NUM_MULTICAST_ADDRESSES);
+	mcnt = if_foreach_llmaddr(ifp, em_copy_maddr, mta);
 
 	if (mcnt >= MAX_NUM_MULTICAST_ADDRESSES) {
 		reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL);


More information about the svn-src-all mailing list