Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765712AbZGABMe (ORCPT ); Tue, 30 Jun 2009 21:12:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761588AbZGAAfn (ORCPT ); Tue, 30 Jun 2009 20:35:43 -0400 Received: from kroah.org ([198.145.64.141]:60630 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761437AbZGAAfb (ORCPT ); Tue, 30 Jun 2009 20:35:31 -0400 X-Mailbox-Line: From gregkh@mini.kroah.org Tue Jun 30 17:24:40 2009 Message-Id: <20090701002440.077312404@mini.kroah.org> User-Agent: quilt/0.48-1 Date: Tue, 30 Jun 2009 17:24:16 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Prabhanjan Sarnaik , Lennert Buytenhek , "David S. Miller" Subject: [patch 087/108] mv643xx_eth: fix unicast filter programming in promiscuous mode References: <20090701002249.937782934@mini.kroah.org> Content-Disposition: inline; filename=mv643xx_eth-fix-unicast-filter-programming-in-promiscuous-mode.patch In-Reply-To: <20090701002838.GA7100@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2244 Lines: 56 2.6.30-stable review patch. If anyone has any objections, please let us know. ------------------ From: Prabhanjan Sarnaik commit 6877f54e6a3326c99aaf84b7bff6a3019da0b847 upstream. The Unicast Promiscious Mode (UPM) bit in the mv643xx_eth port configuration register doesn't do exactly what its name would suggest: setting this bit merely enables reception of all unicast frames with a destination address that differs from our local MAC address in bits [47:4]. In particular, it doesn't have any effect on unicast frames with a destination address that matches our MAC address in bits [47:4] -- these will still be tested against the 16-entry unicast address filter table. Therefore, if the interface is set to promiscuous mode, just setting the unicast promiscuous bit isn't enough -- we need to set all filter bits in the unicast filter table to 1 as well. Reported-by: Sachin Sanap Signed-off-by: Prabhanjan Sarnaik Tested-by: Siddarth Gore Tested-by: Mahavir Jain Signed-off-by: Lennert Buytenhek Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/mv643xx_eth.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -1751,12 +1751,12 @@ static void mv643xx_eth_program_unicast_ uc_addr_set(mp, dev->dev_addr); - port_config = rdlp(mp, PORT_CONFIG); + port_config = rdlp(mp, PORT_CONFIG) & ~UNICAST_PROMISCUOUS_MODE; + nibbles = uc_addr_filter_mask(dev); if (!nibbles) { port_config |= UNICAST_PROMISCUOUS_MODE; - wrlp(mp, PORT_CONFIG, port_config); - return; + nibbles = 0xffff; } for (i = 0; i < 16; i += 4) { @@ -1777,7 +1777,6 @@ static void mv643xx_eth_program_unicast_ wrl(mp, off, v); } - port_config &= ~UNICAST_PROMISCUOUS_MODE; wrlp(mp, PORT_CONFIG, port_config); } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/