From patchwork Sat Feb 27 22:07:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 82751 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1RM7l0P003432 for ; Sat, 27 Feb 2010 22:07:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936318Ab0B0WHq (ORCPT ); Sat, 27 Feb 2010 17:07:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31439 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936317Ab0B0WHp (ORCPT ); Sat, 27 Feb 2010 17:07:45 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1RM7aOq024594 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 27 Feb 2010 17:07:36 -0500 Received: from localhost (vpn1-4-6.ams2.redhat.com [10.36.4.6]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1RM7XxO022318; Sat, 27 Feb 2010 17:07:34 -0500 Date: Sat, 27 Feb 2010 23:07:33 +0100 From: Jiri Pirko To: Jason Gunthorpe Cc: Or Gerlitz , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, davem@davemloft.net, Moni Shoua Subject: Re: [net-next-2.6 PATCH] infiniband: convert to use netdev_for_each_mc_addr Message-ID: <20100227220731.GB6550@psychotron.redhat.com> References: <20100224151108.GD2663@psychotron.lab.eng.brq.redhat.com> <4B862E07.7020002@Voltaire.com> <20100225084915.GA3171@psychotron.redhat.com> <20100227060146.GA13231@obsidianresearch.com> <20100227103835.GA2862@psychotron.redhat.com> <20100227184410.GB13231@obsidianresearch.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100227184410.GB13231@obsidianresearch.com> User-Agent: Mutt/1.5.20 (2009-08-17) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 27 Feb 2010 22:07:49 +0000 (UTC) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index 19eba3c..d41ea27 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c @@ -767,8 +767,11 @@ void ipoib_mcast_dev_flush(struct net_device *dev) } } -static int ipoib_mcast_addr_is_valid(const u8 *addr, const u8 *broadcast) +static int ipoib_mcast_addr_is_valid(const u8 *addr, unsigned int addrlen, + const u8 *broadcast) { + if (addrlen != INFINIBAND_ALEN) + return 0; /* reserved QPN, prefix, scope */ if (memcmp(addr, broadcast, 6)) return 0; @@ -812,6 +815,7 @@ void ipoib_mcast_restart_task(struct work_struct *work) union ib_gid mgid; if (!ipoib_mcast_addr_is_valid(mclist->dmi_addr, + mclist->dmi_addrlen, dev->broadcast)) continue;