kern/117456: ipv6 neighbour discovery / bce multicast problem

Jacek Zapala jacek at ipv6.jacek.it.pl
Mon Oct 29 03:00:07 PDT 2007


The following reply was made to PR kern/117456; it has been noted by GNATS.

From: Jacek Zapala <jacek at ipv6.jacek.it.pl>
To: bug-followup at 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--
 


More information about the freebsd-net mailing list