From patchwork Tue Oct 1 12:46:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2969631 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4597B9F245 for ; Tue, 1 Oct 2013 12:46:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3BE4A20414 for ; Tue, 1 Oct 2013 12:46:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1A21F201EF for ; Tue, 1 Oct 2013 12:46:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753326Ab3JAMq2 (ORCPT ); Tue, 1 Oct 2013 08:46:28 -0400 Received: from mail-ea0-f178.google.com ([209.85.215.178]:38756 "EHLO mail-ea0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753071Ab3JAMq1 (ORCPT ); Tue, 1 Oct 2013 08:46:27 -0400 Received: by mail-ea0-f178.google.com with SMTP id a15so3346842eae.23 for ; Tue, 01 Oct 2013 05:46:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=bT3qo7SFqrgKYeopnGqhjUWxF9QTIp4WoUz6EBrZ2PE=; b=WsENY3lEmKJQ8sbH+YhwgfZuJbLAAFhxM2yJ5nQNv7C/5vUfVz9aPPt1wiJSLjoJbb dobWD7fG4y12oodnilP//F6x2pjKIqfP1q6L43eEBcMNBYjNgxcSckE85OvAdVFA5Czp zYNd8S/NbbExUsafOYbgC7rOUQxojZ1tYJNqzV00AuSVpn2BHihLdhtKWcDefK8Gjm75 5WBvzcUr5AUH0bQsPGXDPP9VYSXEHORYhkmklFB5189J7TqPym1Smohe6tuAT/LsMAUy 6fVl6aIzet4qCJHXgjJFibLy1fDfxG1qa3FTZIvs1Iu0PhEsd2ht5TuWx/Td3gsxdVSV 3Ixw== X-Gm-Message-State: ALoCoQm/D/hx94hnpGKcHbVbWR6bqh4ZrWckeFapKNHgaYC99e/8fBd27z7H7JEkNmrsLUlCSN86 X-Received: by 10.14.127.2 with SMTP id c2mr357489eei.77.1380631585871; Tue, 01 Oct 2013 05:46:25 -0700 (PDT) Received: from [192.168.1.102] (c-98-229-118-119.hsd1.ma.comcast.net. [98.229.118.119]) by mx.google.com with ESMTPSA id v8sm12889805eeo.12.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Oct 2013 05:46:25 -0700 (PDT) Message-ID: <524AC420.1040602@dev.mellanox.co.il> Date: Tue, 01 Oct 2013 08:46:24 -0400 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: "linux-rdma (linux-rdma@vger.kernel.org)" CC: Alex Netes Subject: [PATCH opensm] osm_sa_mcmember_record.c: Fix incorrect comparison of IPv6 MGID when searching for SNM MLID Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alex Netes The whole MGID except of the last 3 bytes should be compared. Signed-off-by: Alex Netes Signed-off-by: Hal Rosenstock --- opensm/osm_sa_mcmember_record.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/opensm/osm_sa_mcmember_record.c b/opensm/osm_sa_mcmember_record.c index 82e3542..5f8e179 100644 --- a/opensm/osm_sa_mcmember_record.c +++ b/opensm/osm_sa_mcmember_record.c @@ -164,7 +164,7 @@ static unsigned match_ipv4_mux_mgid(ib_gid_t * mgid) static int compare_ipv6_snm_mgids(const void *m1, const void *m2) { - return memcmp(m1, m2, sizeof(ib_gid_t) - 6); + return memcmp(m1, m2, sizeof(ib_gid_t) - 3); } static ib_net16_t find_ipv6_snm_mlid(osm_subn_t *subn, ib_gid_t *mgid)