From owner-freebsd-net@FreeBSD.ORG Mon Oct 29 10:00:06 2007 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECB8016A481 for ; Mon, 29 Oct 2007 10:00:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6816F13C481 for ; Mon, 29 Oct 2007 10:00:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l9TA04Fv085780 for ; Mon, 29 Oct 2007 10:00:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l9TA04Mq085779; Mon, 29 Oct 2007 10:00:04 GMT (envelope-from gnats) Date: Mon, 29 Oct 2007 10:00:04 GMT Message-Id: <200710291000.l9TA04Mq085779@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: Jacek Zapala Cc: Subject: Re: kern/117456: ipv6 neighbour discovery / bce multicast problem X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jacek Zapala List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2007 10:00:07 -0000 The following reply was made to PR kern/117456; it has been noted by GNATS. From: Jacek Zapala To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/117456: ipv6 neighbour discovery / bce multicast problem Date: Mon, 29 Oct 2007 10:50:18 +0100 --=-OnEZhZq5git3EvQIW/zR Content-Type: text/plain Content-Transfer-Encoding: 7bit I have found the bug in the bce driver. Patch attached. -- Jacek --=-OnEZhZq5git3EvQIW/zR Content-Disposition: attachment; filename=bce_multicast_patch.diff Content-Type: text/x-patch; name=bce_multicast_patch.diff; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit --- dev/bce/if_bce.c.old Sun Oct 28 02:35:08 2007 +++ dev/bce/if_bce.c Mon Oct 29 10:27:22 2007 @@ -5209,10 +5209,12 @@ { struct ifnet *ifp; struct ifmultiaddr *ifma; - u32 hashes[4] = { 0, 0, 0, 0 }; + u32 hashes[NUM_MC_HASH_REGISTERS]; u32 rx_mode, sort_mode; int h, i; + memset(hashes, 0, 4 * NUM_MC_HASH_REGISTERS); + BCE_LOCK_ASSERT(sc); ifp = sc->bce_ifp; @@ -5257,12 +5259,12 @@ if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = ether_crc32_le(LLADDR((struct sockaddr_dl *) - ifma->ifma_addr), ETHER_ADDR_LEN) & 0x7F; - hashes[(h & 0x60) >> 5] |= 1 << (h & 0x1F); + ifma->ifma_addr), ETHER_ADDR_LEN) & 0xFF; + hashes[(h & 0xe0) >> 5] |= 1 << (h & 0x1F); } IF_ADDR_UNLOCK(ifp); - for (i = 0; i < 4; i++) + for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) REG_WR(sc, BCE_EMAC_MULTICAST_HASH0 + (i * 4), hashes[i]); sort_mode |= BCE_RPM_SORT_USER0_MC_HSH_EN; --=-OnEZhZq5git3EvQIW/zR--