From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 16:45:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52EC493E for ; Sun, 3 Aug 2014 16:45:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2556E2496 for ; Sun, 3 Aug 2014 16:45:08 +0000 (UTC) Received: from marcel (uid 782) (envelope-from marcel@FreeBSD.org) id 584f by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 16:45:08 +0000 From: Marcel Moolenaar Date: Sun, 3 Aug 2014 16:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269479 - head/sys/dev/nfe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53de6714.584f.a7bd1bd@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 16:45:08 -0000 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 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];