Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Aug 2014 16:45:08 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269479 - head/sys/dev/nfe
Message-ID:  <53de6714.584f.a7bd1bd@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Sun Aug  3 16:45:07 2014
New Revision: 269479
URL: http://svnweb.freebsd.org/changeset/base/269479

Log:
  Fix multicast, broken by the conversion of the nfe(4) driver to the
  driver API.
  
  Submitted by:	Mikhail <mp@lenta.ru>

Modified:
  head/sys/dev/nfe/if_nfe.c

Modified: head/sys/dev/nfe/if_nfe.c
==============================================================================
--- head/sys/dev/nfe/if_nfe.c	Sun Aug  3 16:22:14 2014	(r269478)
+++ head/sys/dev/nfe/if_nfe.c	Sun Aug  3 16:45:07 2014	(r269479)
@@ -2582,7 +2582,6 @@ nfe_setmulti(struct nfe_softc *sc)
 	bcopy(etherbroadcastaddr, addr, ETHER_ADDR_LEN);
 	bcopy(etherbroadcastaddr, mask, ETHER_ADDR_LEN);
 
-	if_maddr_rlock(ifp);
 	mc_count = if_multiaddr_count(ifp, -1);
 	mta = malloc(sizeof(uint8_t) * ETHER_ADDR_LEN * mc_count, M_DEVBUF,
 	    M_NOWAIT);
@@ -2594,24 +2593,24 @@ nfe_setmulti(struct nfe_softc *sc)
 
 		bzero(addr, ETHER_ADDR_LEN);
 		bzero(mask, ETHER_ADDR_LEN);
-		free(mta, M_DEVBUF);
-		if_maddr_runlock(ifp);
 		goto done;
 	};
 
-	if_setupmultiaddr(ifp, mta, &mcnt, mc_count);
+	if_multiaddr_array(ifp, mta, &mcnt, mc_count);
 
 	for (i = 0; i < mcnt; i++) {
 		uint8_t *addrp;
+		int j;
 
 		addrp = mta + (i * ETHER_ADDR_LEN);
-		for (i = 0; i < ETHER_ADDR_LEN; i++) {
-			u_int8_t mcaddr = addrp[i];
-			addr[i] &= mcaddr;
-			mask[i] &= ~mcaddr;
+		for (j = 0; j < ETHER_ADDR_LEN; j++) {
+			u_int8_t mcaddr = addrp[j];
+			addr[j] &= mcaddr;
+			mask[j] &= ~mcaddr;
 		}
 	}
-	if_maddr_runlock(ifp);
+
+	free(mta, M_DEVBUF);
 
 	for (i = 0; i < ETHER_ADDR_LEN; i++) {
 		mask[i] |= addr[i];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53de6714.584f.a7bd1bd>